# Code Similarity and Location-Awareness Automatic Program Repair
## 4 Empirical Study
### Experimental Result
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Subject** & **Bug Id** & **Approach** & **Time (min)** & **Candidate** & **Reduced Repair** & **Reduced Candidate** \\  & & & **Patches** & **Time** & **Patches** \\ \hline \multirow{4}{*}{Chart} & C1 & SLARepair & 6.1 & 11 & & \\  & C1 & GenProg & 11.3 & 29 & 46.0\% & 62.1\% \\ \cline{2-7}  & C3 & SLARepair & 10.0 & 23 & & \\  & C3 & GenProg & 34.0 & 71 & 70.6\% & 67.6\% \\ \cline{2-7}  & C5 & SLARepair & 8.7 & 21 & & \\  & C5 & GenProg & 17.0 & 40 & 48.8\% & 47.5\% \\ \cline{2-7}  & C7 & SLARepair & 9.6 & 21 & & \\  & C9 & GenProg & 16.4 & 34 & 41.5\% & 38.2\% \\ \cline{2-7}  & C13 & SLARepair & 12.1 & 19 & & \\  & GenProg & 24.7 & 34 & 51.0\% & 44.1\% \\ \hline \multirow{4}{*}{C15} & SLARepair & 16.7 & 42 & & \\  & GenProg & 34.7 & 82 & 51.9\% & 48.8\% \\ \cline{2-7}  & C25 & SLARepair & 15.8 & 21 & & \\  & GenProg & 33.3 & 40 & 52.6\% & 47.5\% \\ \hline \multirow{4}{*}{M2} & SLARepair & 29.5 & 18 & & \\  & GenProg & 74.5 & 40 & 60.4\% & 55.0\% \\ \cline{2-7}  & SLARepair & 18.2 & 11 & & \\  & GenProg & 67.3 & 64 & 73.0\% & 82.8\% \\ \hline \multirow{4}{*}{M8} & SLARepair & 21.9 & 12 & & \\  & GenProg & 36.5 & 15 & 40.0\% & 20.0\% \\ \cline{2-7}  & SLARepair & 28.0 & 18 & & \\  & GenProg & 85.9 & 48 & 67.4\% & 62.5\% \\ \hline \multirow{4}{*}{M40} & SLARepair & 57.6 & 30 & & \\  & GenProg & 84.7 & 44 & 32.0\% & 31.8\% \\ \cline{2-7}  & C49 & SLARepair & 49.0 & 34 & & \\  & GenProg & 66.4 & 45 & 26.2\% & 24.4\% \\ \hline \multirow{4}{*}{M50} & SLARepair & 8.0 & 15 & & \\  & GenProg & 21.6 & 20 & 63.0\% & 25.0\% \\ \cline{2-7}  & M53 & SLARepair & 18.1 & 14 & & \\  & GenProg & 85.9 & 65 & 78.9\% & 78.5\% \\ \cline{2-7}  & M70 & SLARepair & 51.4 & 24 & & \\  & GenProg & 83.8 & 37 & 38.7\% & 35.1\% \\ \hline \multirow{4}{*}{M73} & SLARepair & 19.4 & 16 & & \\  & GenProg & 82.1 & 98 & 76.4\% & 83.7\% \\ \cline{2-7}  & M80 & SLARepair & 3.0 & 19 & & \\  & GenProg & 13.2 & 80 & 77.3\% & 76.3\% \\ \hline \multirow{4}{*}{M81} & SLARepair & 4.8 & 26 & & \\  & GenProg & 23.6 & 35 & 79.7\% & 25.7\% \\ \cline{2-7}  & M82 & SLARepair & 21.6 & 68 & & \\  & GenProg & 59.0 & 140 & 63.4\% & 51.4\% \\ \hline \multirow{4}{*}{M84} & SLARepair & 22.5 & 67 & & & \\  & GenProg & 40.7 & 110 & & & \\ \cline{2-7}  & SLARepair & 20.1 & 103 & & & \\ \cline{2-7}  & GenProg & 42.5 & 145 & & \\ \hline \multirow{4}{*}{M95} & SLARepair & 23.6 & 45 & & & \\  & GenProg & 51.0 & 90 & 53.7\% & 50.0\% \\ \cline{2-7}  & \multicolumn{1}{c}{} & SLARepair & 23.6 & 45 & & \\ \cline{2-7}  & GenProg & 51.0 & 90 & 53.7\% & 50.0\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of repair efficiency of SLARepair and GenProg on repairable bugs. In order to compare the repair efficiency more intuitively and discuss the differences between different bugs, we drew a bar graph of the execution time of the two repair methods and the number of candidate patches generated based on the data in Table 3, as shown in Figure 7. Among them, the horizontal axis in Figure 7a,b represents the bug Id, and the vertical axis represents the running time (unit: minutes) and the total number of candidate patches. In Figure 7a, it can be clearly observed that the running time of SLARepair is significantly reduced compared with GenProg. In Figure 7b, the change in the number of candidate patches shows the same law as in Figure 7a. Figure 7 intuitively shows that SLARepair's repair ability is better than GenProg's. In Figure 7a,b, the running time and the number of candidate patches generated are quite different between different bugs, which shows that the difficulty of repairing each bug is very different. This phenomenon will exist even in different buggy versions of the same software project. For example, in the Math project, there are 16 different buggy versions from M2 to M95, and the time consumption and the number of candidate patch generations will also fluctuate greatly.