首页|Deep_FGDL:一种基于深度神经网络的细粒度缺陷定位方法

Deep_FGDL:一种基于深度神经网络的细粒度缺陷定位方法

扫码查看
传统静态缺陷定位技术仅能实现函数级或语句级的粗粒度定位,且过度依赖于缺陷报告等标注信息,限制了其在实际应用中的有效性.针对以上问题,本文提出一种基于深度神经网络(Deep Neural Networks,DNN)技术挖掘代码抽象语法树(Abstract Syntax Tree,AST)细粒度特征信息的缺陷定位方法Deep_FGDL.该方法利用正确代码片段构建模板库突破缺乏标注数据的限制.首先,通过代码语义相似度分析方法匹配正确模板进行初步定位.其次,提出了怀疑度公式,结合代码缺陷检测模型对结果进行加权操作,得到最为可能的细粒度缺陷定位.最后,为增强模型有效性,对于无法匹配合适模板的情况,引入了基于缺陷模式的缺陷定位方法.选用SARD数据集,将本文方法与几种静态缺陷定位方法进行实验对比,实验结果表明,该方法定位准确性在Top-5排名上提升15.0%、精确度提升19.1%.
Deep_FGDL:A Fine-grained Defect Localization Method Based on Deep Neural Network
Traditional static defect localization techniques can only achieve coarse-grained localization at the function or statement level and excessively rely on annotated information such as defect reports, thereby limiting their effectiveness in practical applications. To address these issues, this paper proposes a defect localization method called Deep_FGDL, which leverages Deep Neural Networks ( DNN ) to explore fine-grained feature information from the Abstract Syntax Tree ( AST) of the code. The method uses correct code fragments to construct a template library,breaking the limitations of labeled data. Firstly, the method performs preliminary localization by matching the correct template using a code semantic similarity analysis method. Secondly, a suspicion formula is introduced to weigh the results using a code defect detection model, obtaining the most probable defect localization. Finally, to enhance the effectiveness of the model, a defect pattern-based defect localization method is introduced for cases where a suitable template cannot be matched. The evaluation of the proposed method involves conducting experiments using the SARD dataset and comparing it with various other static defect localization methods. The experimental results reveal noteworthy enhancements in the metric of localization accuracy, with a significant increase of 15. 0% in the Top-5 rank and a 18. 2% improvement in precision.

fine-grained defect localizationstatic detectionDNN

宋丽华、韩莹

展开 >

北方工业大学 信息学院,北京100144

细粒度缺陷定位 静态检测 深度神经网络

国家自然科学基金国家自然科学基金北京市自然科学基金

62272007620010074234083

2024

北方工业大学学报
北方工业大学

北方工业大学学报

影响因子:0.368
ISSN:1001-5477
年,卷(期):2024.36(1)
  • 16