Patent ID: 7574697
Filing Date: 2009-08-11
Classification: G06F

Abstract:
1. A method for testing a computer program that includes software code arranged to be executed in multiple threads, including at least a first thread and one or more other threads, the method comprising: identifying an output statement in the first thread, wherein the output statement causes the computer program to output a value of a variable; running the software code on a computer so as to generate a first output due to the output statement, corresponding to a first value of the variable in a first interleaving of the program; instrumenting the software code by inserting an instruction between an assignment statement at which the first value is assigned to the variable and the output statement that generated the first output corresponding to the first value of the variable in the first thread, so that when the program is run, the instruction causes execution of the first thread to be blocked prior to the output statement while the one or more other threads continue to execute, and so that the execution of the first thread will resume only when none of the multiple threads, other than the first thread, is able to continue to execute, whereby a second output, different from the first output, can be observed due to the output statement as a result of a second interleaving of the program, different from the first interleaving; examining the second output generated by the computer after intervening in the program in order to detect a fault in the program arising in the second interleaving; and debugging the software code so as to correct the fault.