# Fault Localization Using TrustRank Algorithm
## 3 Proposed Approach
### Data Pre-Processing  
#### 3.1.1 Program Fault Localization Using Traditional SBFL Techniques  
Program spectra are an important concept in frequency-based fault localization techniques, used to represent information about a program's dynamic behavior and execution paths. It is generated by collecting and analyzing data during program execution and can help developers understand the program's execution process. In fault localization research, program spectra are seen as a measurement unit and are typically described in matrix form to represent statement coverage during program runtime. Statement coverage spectra are one of the most basic types of program spectra. It records which statements were executed and which statements were not executed during program execution. When using statement coverage spectra in practice, the results of test case execution are often combined, and comparing the program coverage spectra corresponding to passed and failed test cases can help rank program elements using suspiciousness calculation formulas. The more frequently a program element is executed in failed tests, and the less frequently it is executed in passed tests, the more suspicious it is considered to be. Suspiciousness value is an indicator used in frequency-based fault localization techniques to measure the potential fault likelihood at different locations in the code. By analyzing program spectra information, four values in Table 1 can be obtained. Based on these four parameters, the suspiciousness value of each program element in the program can be calculated using the suspicious value calculation formula in Table 2, which only lists some commonly used formulas. Algorithm 1 shows the process of calculating suspiciousness values using the SBFL algorithm. ```
1:Program: P
2:Spectrum: Sp
3:Subpicious statements list: S
4:for\(\text{s}_{\text{i}}\) in P do
5: get\(\text{N}_{\text{eff}}\), \(\text{N}_{\text{sp}}\), \(\text{N}_{\text{nf}}\), \(\text{N}_{\text{np}}\) from Sp
6:\(\text{Dstar}=(\text{N}_{\text{eff}})^{\star\star 2}/(\text{N}_{\text{sp}}+\text{N}_{ \text{nf}})\)
7:endfor
8: S = rank \(\text{s}_{\text{i}}\) in P according to Dstar (\(\text{s}_{\text{i}}\))
9:return S



==ERROR: No output for this page==
Defects4J. Considering that the improved algorithm needs to comprehensively consider multi-directional influencing factors between program elements, this leads to a slight decrease in Top-1 ranking compared to TRFL. However, overall, Bi-TRFL is better than TRFL in the Top-5 ranking. This means that TRFL can significantly improve the accuracy of fault localization, and Bi-TRFL can move the ranking of the potentially erroneous program elements forward as a whole, which will greatly save the time for debuggers to locate all the errors in the program. Figures 5 and 6 reflect changes in the EXAM scores for the TRFL and Bi-TRFL, respectively, where the horizontal axis represents the EXAM scores and the vertical axis represents the percentage of correctly located faults out of total faults. Analyzing the experimental results for EXAM scores shows that our proposed method can locate nearly 80% of faults within an EXAM score of 5%. In addition, under TRFL analysis, all erroneous versions can be found within the top 30% of program listings. +++

RQ3: How Does the Decay Factor in the TrustRank Algorithm Affect the Performance of the Proposed Algorithm in This Paper? To answer this question, it is necessary to supplement the experimental content with different configurations to study the impact of internal factors of the algorithm and understand how to achieve better performance for TRFL. The extended experimental content is to modify the internal influencing factor of the algorithm, i.e., the decay factor, in order to explore how different decay factors affect the localization effect of the algorithm. In order to highlight the cost of using our experimental method for researchers to find fault locations, only the EXAM is considered as a metric indicator in this case study.