Abstract:Fault localization is an essential step of software debugging, and spectrum-based fault localization (SFL) is currently amongst the most effective methods. The fundamental premise underlying SFL is that there exists a potential relationship between program spectra and the corresponding execution results. To formally describe and accurately quantify this relation, this paper introduces the conception of conditional probability to construct a P model by using the statistical analysis of experimental data. In addition, based on the presented P model, a fault localization method is proposed to effectively locate the faulty statement of the program under test. Finally, taking seven programs contained in the Siemens suite, Space program and three real-life Unix utility programs as the benchmark, a detailed experiment is conducted to evaluate the effectiveness and efficiency of the proposed method. Compared with fifteen classic fault localization methods, the experimental results show that the presented approach is more promising.