Software defect localization method based on defect report denoising and abstract syntax tree representation
Automated defect localization methods can accelerate the process by which programmers use defect reports to pinpoint defect code in complex software systems.Existing defect localization methods face two main issues:neglecting the impact of noisy information in defect reports and losing significant contextual structural information during code representation.To address these issues,a novel automated defect localization method,named BRFN(bug report fault localization),is proposed.This method first encodes the abstract syntax tree of the program using a bidirectional information propagation mechanism.It then employs TextCNN and attention mechanisms to learn defect-relevant features from defect reports.Finally,it calculates the correlation between defect reports and source code files to perform defect localization.The effectiveness of the BRFN method is evaluated based on four widely used software projects for defect localization research.Experimental results show that BRFN outperforms existing methods such as BugLocator,LS-CNN,and CAST across multiple evaluation metrics.Specifically,BRFN improves Acc@1,MRR,and MAP by 56.3%,43.4%,and 46%,respectively,on four open-source projects.Additionally,ablation experiments are conducted to validate the contribution of each module in BRFN.The results indicate that both the defect report denois-ing strategy and bidirectional information propagation strategy enhance the accuracy of defect localization.