# Code Similarity and Location-Awareness Automatic Program Repair
## 4 Empirical Study
### Experimental Result
The bugs M56, M71, and M78 cannot find effective patches in the application space. This is because the ingredient space is too large and the repair time exceeds the pre-set 90 min. The most special thing is that M60 can only be repaired correctly within the scope of application, because the correct repair ingredients only exist in another package. For the above special cases, the search space is automatically expanded when the location-awareness repair approach cannot complete the repair in a smaller search space. Therefore, SLARepair's location-awareness repair capabilities can improve repair efficiency while ensuring repair accuracy. Figure 7: SLARepair and GenProg running time on repairable bugs and generating a bar graph of candidate patches. (**a**) SLARepair and GenProg running time spent on repairable bugs. (**b**) SLARepair and GenProg generate candidate patches for repairable bugs. 4.5.2 RQ2: How Does the SLARepair Repair Method Compare with Other Existing Advanced Repair Methods? We chose the popular repair methods jKali [22], Nopol [23], CapGen [15], and SimFix [10] to compare with this study, where jKali is the Java implementation version of the Kali [24] repair method on Defects4J. The experimental data of jKali and Nopol are based on the \(\alpha\)-\(\beta\) model. The results are shown in Figure 8.  
Figure 8: Time to repair math project bugs on SLARepair in three ingredient spaces of class, package, and application. on the display of [PERSON] et al. in [22]. [PERSON] et al. verified the actual repair effect of jKali and Nopol on Defects4J under the same hardware and software conditions. The experiment uniformly uses the 180-min operating limit, so the experimental data in [22] is more authentic and credible. The experimental results of CapGen and SimFix come from their corresponding research papers, in which the upper limit of CapGen repair time is 90 min and the upper limit of SimFix repair time is 300 min. As shown in Table 4, SLARepair can successfully repair 43 bugs out of 224 bugs in Defects4J, with a success rate of 19.2%. In other repair methods, a maximum of 35 bugs can be repaired. Therefore, the repair ability of SLARepair is superior to these repair methods. Figure 9 more intuitively shows the repair quantity of SLARepair and the other 4 repair methods on the Chart, Lang, Math, and Time projects. We can see that in the Chart project shown in Figure 9a and the Math project shown in Figure 9c, the number of bugs that SLARepair can repair is significantly higher than the other four methods. It can be seen from Figure 9d that in the Time project, SLARepair and jKali can repair two bugs, while the remaining three repair methods can only repair one at most. This is because the Time project is too complex, resulting in a small number of repairable faults in the existing repair methods. As shown in Figure 9b, SLARepair has poor repair performance on the Lang project. The number of repairable bugs is one less than Nopol and two less than SimFix. This is because the correct repair ingredients for most of the bugs in the Lang project cannot be searched at the statement granularity level of the program itself, while Nopol can synthesize patches through constraint solving at a finer program granularity, and SimFix can also repair these bugs with the help of external repair templates. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Project** & **SLARepair** & **jKali** & **Nopol** & **CapGen** & **SimFix** \\ \hline Chart (26) & 10 & 6 & 6 & 4 & 8 \\ Lang (65) & 6 & 0 & 7 & 5 & 8 \\ Math (106) & 25 & 14 & 21 & 13 & 14 \\ Time (27) & 2 & 2 & 1 & 0 & 1 \\ Total (224) & 43 & 22 & 35 & 22 & 31 \\ \hline success rate & 19.2\% & 9.8\% & 15.6\% & 9.8\% & 13.8\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of the number of bugs repaired by SLARepair and the existing four methods. Figure 9: _Cont._  
Finally, we discuss the time-consumption problem of SLARepair's patch verification during the repair process.