首页|基于缺陷报告降噪和抽象语法树表示的软件缺陷定位方法

基于缺陷报告降噪和抽象语法树表示的软件缺陷定位方法

扫码查看
自动化的缺陷定位方法能够加快程序员利用缺陷报告定位到复杂软件系统缺陷代码的过程。现有相关缺陷定位方法存在两方面问题:忽略了缺陷报告中噪音信息的影响;程序代码表示的过程中丢失了大量的上下文结构信息。为了解决上述问题,提出一种自动化缺陷定位方法BRFN(bug report fault localization)。该方法首先利用双向的信息传播机制对程序的抽象语法树进行编码;接着针对缺陷报告使用TextCNN和注意力机制学习与缺陷相关的特征;最后通过计算缺陷报告和源代码文件之间的相关性,开展缺陷定位,并基于 4 个广泛用于缺陷定位研究的软件项目评估BRFN方法的有效性。实验结果表明,相较于BugLocator、LS-CNN和CAST现有的缺陷定位方法,BRFN在多个评价指标上均取得了更好的效果。具体而言,BRFN在 4 个开源项目上的Acc@1、MRR和MAP性能平均提升了 56。3%、43。4%和 46%。此外,进一步设计消融实验来验证BRFN中各模块的贡献。结果表明,缺陷报告降噪策略和双向信息传播策略可以提升缺陷定位的准确性。
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.

defect localizationdeep learninginformation retrievalattention mechanismprogram representation learning

石翔宇、鞠小林、陈翔

展开 >

南通大学 人工智能与计算机学院,江苏 南通 226019

缺陷定位 深度学习 信息检索 注意力机制 程序表示学习

2024

南通大学学报(自然科学版)
南通大学

南通大学学报(自然科学版)

影响因子:0.292
ISSN:1673-2340
年,卷(期):2024.23(3)