Automatic Testing of Exception Handling Code
- 288 Downloads
Robust applications have to gracefully handle runtime errors that occur during program execution. Recent studies have shown, however, that code related to error handling is the most likely to contain software bugs: first, because it is almost never exercised under normal operation; and second, because errors modify the control flow of the program and render error handling code inherently complex. It is thus of utmost importance for software robustness to carefully and systematically test error handling code.
In this chapter, we describe automated tools to exercise and validate error handling code in modern programming languages that support exceptions, such as C++ and Java. We first introduce the notion of “failure atomicity,” which informally states that a software component must remain in a consistent state after an exception has been thrown for the error to be recoverable. This property is essential, because it constitutes a prerequisite for using the component in a robust application. We then propose automated mechanisms based on code instrumentation for injecting exceptions in a program and verify consistent operation of the error handling code. Experiments illustrate the usefulness of our techniques with real-world applications.
KeywordsFault Injection Exception Handling Object Graph Error Handling Branch Coverage
Unable to display preview. Download preview PDF.