一句话:提出 SOUND,结合历史缺陷行的频谱信息与因果分析进行代码行级缺陷预测,显著提升缺陷行排序效果。
代码行级缺陷预测(CLDP)用于在软件质量保障中定位含缺陷代码行。现有方法多依赖代码文本或文件级标签,未充分利用历史代码行级标签;而行数庞大且 token 稀疏,使这些标签难以直接利用。本文提出 SOUND,融合两种思想:一是引入频谱信息视角,利用历史缺陷行标签量化 token 对行级缺陷的贡献;二是应用因果分析,更系统全面地刻画 token 与缺陷之间的因果关系。在 19 个软件项目、142 个 release 上评估,SOUND 在 IFA、Recall@Top20%LOC 与 Effort@Top20%Recall 三个指标上显著优于 SOTA CLDP 基线;多数情况下 IFA 为 0,即排序首位即为真实缺陷行。
Code-line-Ievel defect prediction (CLDP) is an effective technique to incorporate comprehensive measures for buggy line identification to optimize efforts in Software Quality Assurance activities. Most CLDP methods either consider the textual information of the code or rely merely on file-level label information, which have not fully leveraged the essential information in the CLDP context, with historical code-line-level labels being incredibly overlooked in their application. Due to the vast number of code lines and the sparsity of the tokens they contain, leveraging historical code-line-level label information remains a significant challenge. To address this issue, we propose a novel CLDP method, Spectrum infOrmation and caUsality aNalysis based coDe-line-level defect prediction (SOUND). SOUND incorporates two key ideas: (a) it introduces a spectrum information perspective, utilizing labels from historical defective lines to quantify the contribution of tokens to line-level defects, and (b) it applies causal analysis to obtain a more systematic and comprehensive understanding of the causal relationships between tokens and defects. After conducting a comprehensive study involving 142 releases across 19 software projects, the experimental results demonstrate that our method significantly outperforms existing state-of-the-art (SOTA) CLDP baseline methods in terms of its ability to rank defective lines under three indicators, IFA, Recall@Top20%LOC, and Effort@Top20%Recall. Notably, in terms of IFA, our method achieves a score of 0 in most cases, indicating that the first line in the ranking list generated by our method is actually defective, significantly enhancing its practicality.
DOI 原文 ·
@inproceedings{paperbot8769,
title = {Boosting Code-line-level Defect Prediction with Spectrum Information and Causality Analysis},
author = {Shiyu Sun and Yanhui Li and Lin Chen and Yuming Zhou and Jianhua Zhao},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00240}
}