# LSTM Attention-Driven Similarity Learning for Effective Bug Localization
## 5 Experimental Result
### Result
#### 5.5.2 Comparison Results  
Figures 11 and 12 present a comparative analysis of the proposed bug localization model against several baseline methods, including DNNLoc, learn-to-rank (LR), BugLoc (BL), and Naive Bayes (NB). The x-axis in Figure 11 represents different K-ranked buggy files, while the y-axis denotes accuracy values. The results indicate that the proposed model consistently outperforms the baseline methods across all evaluated projects. The proposed model achieved an average bug localization accuracy of 89.27% for Tomcat, 80.43% for AspectJ, 78.14% for Birth, 81.12% for Eclipse, 72.63% for JDT, and 72.99% for SWT. These results highlight that the proposed method consistently shows high accuracy across various software projects. Compared with DNNLoc, the proposed model achieved an average performance improvement of approximately 17.54 points, showing its enhanced capability in identifying buggy files. Additionally, the model outperformed the LR, BL, and NB baselines, confirming its superiority over conventional bug localization techniques. Figure 12 presents the comparative results in terms of Mean Reciprocal Rank (MRR) and Mean Average Precision (MAP), which measure ranking effectiveness and precision across recommended buggy files. The proposed model achieved an average MRR of approximately 0.68 and a MAP of around 0.62. In comparison, DNNLoc recorded an average MRR of 0.46 and a MAP of 0.36. This results in a performance difference of approximately 0.22 in MRR and 0.26 in MAP in favor of the proposed model. The improvements observed in MRR and MAP indicate that the proposed method not only predicts buggy files more accurately but also ranks them higher in the recommendation list, making it more effective for real-world debugging tasks. Figure 10: Comparison of Performance between LSTM-Attention, LSTM, and Attention. Figure 11: Performance comparison between Baselines in Accuracy. Figure 12: Performance Comparison between Baselines in MRR and MAP. The consistent improvement observed across multiple evaluation metrics underscores the effectiveness of integrating LSTM-Attention with top-K code similarity learning in bug localization. These findings validate the robustness and efficiency of the proposed model compared with state-of-the-art baselines, making it a promising approach for enhancing automated bug localization in software maintenance. A statistical verification was conducted to assess the significance of differences between the proposed bug localization model and baseline methods, as referenced in [43; 44]. The verification process involved Shapiro-Wilk normality testing to determine whether the performance results of the proposed model and baselines followed a normal distribution. If the normality test yielded a \(p\)-value greater than 0.05, an independent \(t\)-test [43] was performed. If the \(p\)-value was less than 0.05, indicating a non-normal distribution, the Wilcoxon signed-rank test [44] was applied as a non-parametric alternative. To test for significant performance differences, null hypotheses (H0) and alternative hypotheses (H0) were formulated. The null hypothesis stated that there were no significant differences between the proposed model and the baseline models across the six software projects (Tomcat, Aspect), Birt, Eclipse, JDT, and SWT). These hypotheses were defined as follows:  
**H10, H20, H30, H40, H50, and H60**: No significant differences between the proposed model and DNNLoc for Tomcat, Aspect), Birt, Eclipse, JDT, and SWT. **H70, H80, H90, H100, H110,** and H120**: No significant differences between the proposed model and learn-to-rank (LR) for the six projects. **H130, H140, H150, H160, H170,** and H180**: No significant differences between the proposed model and BugLocator (BL) for the six projects. **H190, H200, H210, H220, H230,** and H240**: No significant differences between the proposed model and Naive Bayes (NB) for the six projects.