arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.07132cs.SE
收藏

BAFLineDP:用于行级缺陷预测的代码双线性注意力融合框架

BAFLineDP: Code Bilinear Attention Fusion Framework for Line-Level Defect Prediction

Shaojian Qiu, Huihao Huang, Jianxiang Luo, Yingjie Kuang, Haoyu Luo

AI总结:

提出BAFLineDP框架,融合代码行语义、上下文及局部交互信息,实现行级缺陷预测,在9个项目32版本上优于现有方法。

摘要:

软件缺陷预测旨在识别有缺陷的代码,帮助开发者优化测试资源分配。大多数缺陷预测方法主要关注粗粒度的文件级缺陷预测,这无法为开发者提供定位缺陷代码所需的精度。近期,一些研究者提出了细粒度的行级缺陷预测方法。然而,这些方法大多缺乏对代码行上下文语义的深入考虑,并忽略了代码行之间的局部交互信息。为解决上述问题,本文提出了一种基于代码双线性注意力融合框架(BAFLineDP)的行级缺陷预测方法。该方法通过整合源代码行语义、行级上下文以及代码行与行级上下文之间的局部交互信息来识别有缺陷的代码文件和代码行。通过对9个不同项目(涵盖32个版本)进行项目内和跨项目缺陷预测的广泛分析,我们的结果表明BAFLineDP优于当前先进的文件级和行级缺陷预测方法。

英文摘要:

Software defect prediction aims to identify defect-prone code, aiding developers in optimizing testing resource allocation. Most defect prediction approaches primarily focus on coarse-grained, file-level defect prediction, which fails to provide developers with the precision required to locate defective code. Recently, some researchers have proposed fine-grained, line-level defect prediction methods. However, most of these approaches lack an in-depth consideration of the contextual semantics of code lines and neglect the local interaction information among code lines. To address the above issues, this paper presents a line-level defect prediction method grounded in a code bilinear attention fusion framework (BAFLineDP). This method discerns defective code files and lines by integrating source code line semantics, line-level context, and local interaction information between code lines and line-level context. Through an extensive analysis involving within- and cross-project defect prediction across 9 distinct projects encompassing 32 releases, our results demonstrate that BAFLineDP outperforms current advanced file-level and line-level defect prediction approaches.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑