Abstract:
Spectrum-based fault localization (SBFL) has been proven to be the promising technique during software debugging. SBFL combined various factors in the execution profile to form different fault localization models. However, these models are still agnostic to the particular program and dataset. In this paper we propose a learning to rank method referred to as LTR-sbfl which automatically constructs the SBFL model for each program. Like the existing SBFL methods, we first collect program execution traces and results of test cases. Next, it is directly mapped from the coverage difference in a pair of faulty statement and non-faulty statement to an instance in supervised learning. Finally, the conventional classification algorithm is applied to learn a ranking model for a program based on the training data. The proposed method on three benchmark datasets is evaluated through experiment. Results show that LTR-sbfl can outperform other SBFL approaches in the precision of fault localization.