Automated fault localization with statistically suspicious program states
Taiyi Huang, Pin-Chuan Chou, Cheng-Han Tsai, Hsin-An Chen · 2007
A number of fault localization techniques have been developed to reduce the time in manually debugging a faulty program. The technique of code coverage [8] has been recognized by its effectiveness in identifying suspicious statements that may contain the fault. However, a programmer still needs to manually examine each variable referenced in a suspicious statement and such a process can become extremely time-consuming if this suspicious statement is part of a loop. In this paper, we propose a novel technique called state coverage to significantly reduce the time in examining variables. We first insert a set of checkpoints to record the state of each variable referenced in a branching statement. We next execute the faulty program by a test suite consisting of both passed and failed cases. A state is statistically considered to be more suspicious if it appears more in failed cases and less in passed cases. We implemented both code coverage and state coverage in a debugging tool and used a commonly-used benchmark consisting of 58 faulty programs to evaluate their performance. For 34% of these programs, their faults are within 20 statement steps of the most suspicious statement identified by code coverage. By adding state coverage and breaking at the most suspicious state, we increase this ratio to 64%, an 88% performance improvement. Finally, we also explain a few cases in which both state coverage and code coverage cannot perform well.