In software, there are the errors anticipated at specification and design time, those encountered at development and testing time, and those that happen in production mode yet never anticipated. In this paper, we aim at reasoning on the ability of software to correctly handle unanticipated exceptions. We propose an algorithm, called short-circuit testing, which injects exceptions during test suite execution so as to simulate unanticipated errors. This algorithm collects data that is used as input for verifying two formal exception contracts that capture two resilience properties. Our evaluation on 9 test suites, with 78 line coverage in average, analyzes 241 executed catch blocks, shows that 101 of them expose resilience properties and that 84 can be transformed to be more resilient.
Exception mechanism is important for the development of robust programs to make sure that exceptions are handled appropriately at run-time. In this paper, we develop a dynamic exception monitoring system, which can trace handling and propagation of thrown exceptions in real-time. With this tool, programmers can examine exception handling process in more details and handle exceptions more effectively. Programmers can also trace only interesting exceptions by selecting options before execution. It can also provides profile information after execution, which summarizes exception handling in each method during execution. To reduce performance overhead, we implement the system based on code inlining, and presents some experimental results.