Abstract:Software fault localization tasks begin with the program execution failure, and locate the root cause of the fault at the code level by analyzing the abnormal internal state during program execution. The current mainstream spectrum-based and mutation-based fault localization techniques, and state-of-the-art technique SmartFL utilize coverage information, mutation information, and information represented by program semantics respectively as windows to observe the internal state of the program. The employed information is too broad and not targeted enough, and the three types of technology are limited by bottlenecks such as the tie of statement risk values, excessive mutation cost, and large information scale. To this end, EXPECT, a fault localization technique based on exception trigger information, has been proposed recently to monitor the execution state of program failure via the program’s built-in exception handling statements (Try-catch blocks), achieving fault localization effectiveness that surpasses the aforementioned mainstream techniques at a lower cost. The premise of EXPECT is that the faulty program must contain enough exception handling statements. However, in the real open-source environments, many software programs do not have a good exception handling mechanism, which causes their codes to contain only very sparse or even no exception handling statements, thus directly affecting the basis on which EXPECT runs. To this end, a software fault localization method based on exception checkpoint injection, INSPECT (inserted checkpoint-based fault localization), is proposed. By automatically injecting temporary exception handling statements into the faulty program as checkpoints for the internal state during running, and designing a more sophisticated method for program statements’ risk value calculation, the application scope of EXPECT is extended to more general programs that do not contain exception handling statements. The application scenario of exception trigger information as an efficient source of data for fault localization is extended to achieve generalization improvement. Experimental results show that INSPECT obtains better fault localization effectiveness than the current state-of-the-art technique with improvements of 95.25%, 55.92%, and 16.65% (simulated faults) as well as 93.39%, 57.54%, and 13.92% (real-world faults) in the best, average, and worst EXAM metrics respectively, and 311.47% (simulated faults) and 283.31% (real-world faults) in the MRR metric.