# Fault Localization Using TrustRank Algorithm
## 1 Introduction
By analyzing data dependencies, attention can be focused on code segments directly related to faults, thereby improving fault localization efficiency. In this paper, in order to overcome the limitations of existing SBFL methods, the data dependency relationships within the program during runtime are fully considered by utilizing test cases and program execution information. The data dependencies obtained through analysis are combined into a program execution network within the program under test or between the program under test and the test suite. Ultimately, a network centrality analysis algorithm is used to analyze suspicious situations in the program. Based on an understanding of the current research status, an automatic debugging technology called TrustRank-based fault localization (TRFL) is proposed. The TrustRank algorithm is used to fully consider implicit testing information to improve traditional fault localization technology. TRFL captures links between test cases and program entities (e.g., traditional coverage spectra) as well as links between internal program elements (e.g., data dependency graphs). The TrustRank algorithm can adaptively assign different weights to program elements based on their impact, and program entities linked with suspicious entities may also be more suspicious because they may have propagated fault states to linked entities. In addition, an improved TrustRank algorithm (Bi-TRFL) is proposed that fully considers fault propagation between adjacent links of fault program elements and positive influence propagation between fully trusted nodes and adjacent nodes. Finally, program elements are ranked according to their analyzed suspiciousness levels by the algorithm, which helps eliminate interference from duplicate suspiciousness scores and perform fault localization. Details about TRFL and Bi-TRFL are presented in Section 3. The experimental object is the specific location of 348 real faults in the Defects4] benchmark for fault localization. Overall, this research work makes the following contributions:  
1. A fault localization research method is proposed that extracts data dependency relationships during program execution combines effective content analyzed by SBFL with the TrustRank method, and rebuilds new suspicious score levels, thereby expanding the original SBFL method and improving automatic debugging efficiency while reducing the workload and research costs of researchers;2. The TrustRank algorithm (TRFL) is improved to obtain a bidirectional TrustRank algorithm (Bi-TRFL), which fully considers the influence relationship between node outdegree and indegree on adjacent nodes in the network. Experiments show that Bi-TRFL can improve the overall ranking of fault locations in the suspicious list;
3. TRFL and Bi-TRFL are compared with traditional SBFL, using Top-N ranking and EXAM scores on the Defects4] benchmark dataset for experimental evaluation. The experimental results show that TRFL is significantly better than the state-of-the-art SBFL techniques (e.g., TRFL can improve nearly 40% over traditional SBFL at Top-1, almost all traditional localization techniques can be improved using calculation formulas, while Bi-TRFL can save 10% of overall localization costs compared to TRFL);
4. The performance of the algorithm is verified by modifying the decay factor in the TRFL and Bi-TRFL methods. The experimental results show that changing the decay factor within 4% has little effect on the performance of the algorithm, demonstrating the good robustness of the algorithm. The remaining research work in this paper is arranged as follows. Section 2 reviews related work on spectrum-based fault localization (SBFL), complex networks, network centrality, etc. Then, the proposed TRFL and Bi-TRFL methods are analyzed in Section 3. Section 4 explains the experimental dataset, tools, and evaluation metrics. In Section 5, the experimental results are discussed. Finally, conclusions are drawn, and prospects for future research work are presented in Section 6.