paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Fault Localization with Code Coverage Representation Learning

基于代码覆盖率表示学习的故障定位
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 该论文属于机器学习用于程序调试/故障定位,与“PL→AI”有宽泛交叉,但没有涉及静态分析、Agentic/LLM 程序、浮点程序分析或贝叶斯程序分析,与用户画像的核心问题不匹配。引用 184 inbox
Yi Li, Shaohua Wang, Tien Nguyen
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 DeepRL4FL,将故障定位视为图像模式识别,融合代码覆盖率、数据依赖与源码表示学习,显著提升语句级与方法级定位精度。

该论文研究自动化故障定位(FL),目标是在语句与方法粒度上找出缺陷代码。作者提出 DeepRL4FL,其核心思想借鉴犯罪现场调查:既分析失败测试用例与语句构成的“犯罪现场”,又考察与之存在数据依赖的“相关人员”,同时参考训练数据中历史相似缺陷代码这一“惯犯”。方法上,首先对测试用例排序并标记暴露错误的语句,将代码覆盖率矩阵转化为可供卷积神经网络识别的图像模式;其次对语句间的数据依赖进行表示学习,使语句可疑度不仅取决于自身,还考虑执行与数据流中的依赖关系;最后把覆盖率矩阵、数据依赖与源码三者的向量表示拼接,输入基于 CNN 的分类器,实现语句级与方法级缺陷检测。实验表明,DeepRL4FL 在语句级 FL 基线上将 top-1 结果提升 173.1% 至 491.7%,在方法级基线上提升 15.0% 至 206.3%。

问题
如何利用动态覆盖率信息与静态源码信息,在语句和方法两个粒度上更准确地自动定位缺陷代码。
方法
将故障定位建模为图像模式识别:对覆盖率矩阵做表示学习并标记错误语句,对语句间数据依赖做表示学习,再与源码表示拼接,送入 CNN 分类器判别可疑语句/方法。
评估
在标准故障定位基准上与当前最优的语句级和方法级基线对比 top-1 精度,语句级提升 173.1%–491.7%,方法级提升 15.0%–206.3%。
原文摘要(Abstract)

In this paper, we propose DeepRL4FL, a deep learning fault localization (FL) approach that locates the buggy code at the statement and method levels by treating FL as an image pattern recognition problem. DeepRL4FL does so via novel code coverage representation learning (RL) and data dependencies RL for program statements. Those two types of RL on the dynamic information in a code coverage matrix are also combined with the code representation learning on the static information of the usual suspicious source code. This combination is inspired by crime scene investigation in which investigators analyze the crime scene (failed test cases and statements) and related persons (statements with dependencies), and at the same time, examine the usual suspects who have committed a similar crime in the past (similar buggy code in the training data). For the code coverage information, DeepRL4FL first orders the test cases and marks error-exhibiting code statements, expecting that a model can recognize the patterns discriminating between faulty and non-faulty statements/methods. For dependencies among statements, the suspiciousness of a statement is seen taking into account the data dependencies to other statements in execution and data flows, in addition to the statement by itself. Finally, the vector representations for code coverage matrix, data dependencies among statements, and source code are combined and used as the input of a classifier built from a Convolution Neural Network to detect buggy statements/methods. Our empirical evaluation shows that DeepRL4FL improves the top-1 results over the state-of-the-art statement-level FL baselines from 173.1% to 491.7%. It also improves the top-1 results over the existing method-level FL baselines from 15.0% to 206.3%.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{Li0N21a,
  title = {Fault Localization with Code Coverage Representation Learning},
  author = {Yi Li and Shaohua Wang and Tien Nguyen},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00067}
}