SCIENCE CHINA Information Sciences, Volume 60, Issue 9: 092113(2017) https://doi.org/10.1007/s11432-017-9112-2

Lightweight fault localization combined with fault context to improve fault absolute rank

More info
  • ReceivedJan 3, 2017
  • AcceptedMay 31, 2017
  • PublishedJul 27, 2017


Lightweight fault localization (LFL), which outputs a list of suspicious program entities in descending order based on their likelihood to be a root fault, is a popular method used by programmers to assist them in debugging. However, owing to the nature of program structures, it is impossible for LFL to always rank the root faulty program entity at the top of a ranking list. Recently, Xia et al. noted in their study that programmers inspect the first top-K-ranked program entities outputted by an LFL tool in sequence. Therefore, it is of practical significance to further improve the absolute rank of those buggy programs by using LFL if the root fault is ranked higher. To solve this issue, we propose a new LFL combined with a fault context to improve the fault absolute rank. We conduct experiments in which we apply our proposed approach to seven Siemens benchmark programs. The results show that by combining the suspiciousness scores of program entities with their fault-context suspiciousness scores that are based on an LFL called Dstar, our approach can improve the fault absolute rank with an effectiveness rate of 35.7% for 129 faulty versions from the seven benchmark programs. It should be noted that our approach can obtain an average improvement of 65.18% for those improved programs to which LFL can be effectively applied, and that there were improvements to seven top-ranked root faults of buggy programs.


This work was supported by National High Technology Research and Development Program of China (863) (Grant No. 2015AA015303), National Natural Science Foundation of China (Grant Nos. 61272083, 61562087, 71371012, 61300170, 61572033), Key Support Program Projects for Outstanding Young Talents of Anhui Province (Grant No. gxyqZD2016124), Advanced Research of National Natural Science Foundation (Grant No. 2016yyzr10), and Anhui Natural Science Foundation (Grant Nos. KJ2016A252, 1608085MF147).

  • Figure 1

    (Color online) A buggy program and its program spectrum.

  • Figure 2

    (Color online) Control flow graph and failed execution traces.

  • Figure 3

    (Color online) Comparison of FCLFL-Dstar with Dstar.

  • Figure 4

    (Color online) Comparison of the effectiveness of different scales for the fault context. (a) Comparison effectiveness for different scales; (b) average improvement for different scales.

  • Figure 5

    (Color online) Comparison of the effectiveness of different LFL methods for the fault context.

  • Figure 6

    (Color online) Comparison of absolute rank between LFLs

  • Figure 7

    (Color online) Cumulative comparison for LFLs


    Algorithm 1 FCLFL algorithm

    Require:Program $P$, test suite $\Gamma$, and suspiciousness metric $\rho_b$;

    Output:fault rank list $\Omega$;

    //step 1: suspiciousness measurement for program entities;

    $\left(A,e\right)\leftarrow \text{Run}\_\text{program}\left(P,\Gamma\right)$;


    $M\leftarrow {\rm getNumberofComponents}(P)$;

    $\Omega\leftarrow \emptyset$;

    for $i = 0 \text{to} M$

    $\{n_{00}\left(j\right),n_{01}\left(j\right),n_{10}\left(j\right),n_{11}\left(j\right)\}\leftarrow 0$;

    end for

    for $i = 0 \text{to} M$

    set values $\left(n_{00}\left(j\right),n_{01}\left(j\right),n_{10}\left(j\right),n_{11}\left(j\right)\right)$;

    end for

    for $i = 0 \text{to} M$

    $S[i]\leftarrow \rho_b\left(n_{00}\left(j\right),n_{01}\left(j\right),n_{10}\left(j\right),n_{11}\left(j\right)\right)$;

    end for

    //step 2: suspiciousness measurement for fault contexts;

    // normalize $S$ to make $\sum s_i=1$;


    for $j = 0 \text{to} M$

    // get fault context of program entities $j$;

    ${\rm fc}\_j = \text{get}\_\text{fault context}\left(A,e,j\right)$;

    //calculate suspiciousness score for each program entity's fault context;

    $S\_{\rm fc}\left[j\right] = \rho_{c}\left({\rm fc}\_j,S\right)$;

    end for

    //step 3: fault rank list generation;

    $\Omega \leftarrow \text{sort}\left(S,S\_{\rm fc}\right)$;

    return $\Omega$.

Copyright 2020 Science China Press Co., Ltd. 《中国科学》杂志社有限责任公司 版权所有

京ICP备18024590号-1       京公网安备11010102003388号