The dominance of object-oriented design has not eliminated the use of the procedural models of API design. Use of and adaptation to older but ubiquitous procedural APIs such as POSIX suggest using returns and/or the global
errno to communicate meaningful values corresponding to error conditions. Many POSIX calls, such as
open(2),1 return an integer
-1 on error and use a range of
errno values for the error details.
We have explored various ways to inject values into our code for testing purposes. We use those same techniques to inject procedural error codes. Commonly, we will thinly encapsulate procedural system APIs such as POSIX such that they ...