Patent ID: 8533679

Claim:
A method for inserting faults to test code paths, comprising: placing fault-inserting method calls at join points in methods in program code; executing the program code during a testing process; and as a method is executed during the testing process, executing the corresponding fault-inserting method, wherein the fault-inserting method checks a configuration database to determine whether a fault is to be simulated for the method and, if so, simulates a fault for the method, wherein simulating the fault for the method comprises: determining whether an entry for the method in the configuration database indicates that the method should appear to throw an exception that is known to be thrown for the method or return an error code that is known to be returned for the method; when the entry indicates that the method should appear to throw the exception, simulating the fault by using the fault-inserting method to throw the exception; and otherwise, when the entry indicates that the method should appear to return the error code, simulating the fault by using the fault-inserting method to return the error code to the method.