Abstract
Any programs, when in the presence of I/O failures such as network or file access failures, should include proper exception handling code. However, unit testing of such code is difficult since those external failures are sporadic in nature and so irreproducible. We propose a software fault injection based technique to simulate I/O failures in a reproducible manner. We also extend the format of a JUnit test case to specify not only an input and an output but also a kind and timing of external failure. Our proposals provide a framework for automated regression testing even in the presence of sporadic failures.