paperbot · PL 论文追踪

全部论文 待读 收藏

P2 DEAR

DEAR:支持多代码块、多语句一次性修复的深度学习自动程序修复
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 3/10 · 该论文是深度学习驱动的自动程序修复,结合频谱定位与数据流分析,属于机器学习与程序语言/软件工程的交叉,但与画像核心的 LLM/Agent 程序静态分析、AI 辅助静态分析/形式化验证、浮点程序分析和贝叶斯程序分析均无直接关联。它主要解决缺陷修复问题,而非用户正在追的 PL 与 LLM/Agent 交叉方向。引用 127 inbox
Yi Li, Shaohua Wang, Tien N. Nguyen
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:DEAR 结合频谱定位、深度学习与数据流分析定位缺陷,并用两级树状 LSTM 一次性修复跨代码块的多语句缺陷。

现有基于深度学习的自动程序修复(APR)模型大多只能处理单点、局部修改,难以修复需要在一个或多个代码块中对一条或多条连续语句同时做依赖变更的通用软件缺陷。为应对该问题,本文提出 DEAR。其一是面向多代码块、多语句修复的新型缺陷定位技术:先用频谱定位(SBFL)模型给出可疑语句,再结合深度学习与数据流分析判定需一次性修复的缺陷代码块,并将块内某条可疑语句扩展为包含其周围可疑语句的修复上下文。其二是两级、基于树的 LSTM 模型,通过循环训练与分治策略,在由周围子树构成的合适修复上下文中学习多条语句的代码变换。作者在 Defects4J、BigFix 与 CPatMiner 三个数据集上评估:在 Defects4J 上仅用 top-1 补丁即可比基线多修复 42%–683% 的缺陷,在 BigFix 上比现有 DL-based APR 模型多修复 31–145 个缺陷;在 CPatMiner 上,其修复的 667 个缺陷中 169 个(25.3%)属于多代码块/多语句缺陷,且相对最先进的 DL-based APR 模型分别多修复 71 与 164 个缺陷,其中包括 52 与 61 个多代码块/多语句缺陷。

问题
现有的深度学习自动程序修复模型局限于局部、单点的修改,无法修复需要一次性对多个代码块或多条连续语句做依赖变更的通用缺陷。
方法
提出融合频谱定位、深度学习与数据流分析的多代码块/多语句缺陷定位技术,并设计带循环训练与分治策略的两级树状 LSTM,为多条语句学习合适的代码变换。
评估
在 Defects4J、BigFix 与 CPatMiner 三个数据集上进行实验,以 top-1 补丁的自动修复缺陷数等指标与现有 DL-based APR 基线比较。
原文摘要(Abstract)

The existing deep learning (DL)-based automated program repair (APR) models are limited in fixing general software defects. We present DEAR, a DL-based approach that supports fixing for the general bugs that require dependent changes at once to one or mul-tiple consecutive statements in one or multiple hunks of code. We first design a novel fault localization (FL) technique for multi-hunk, multi-statement fixes that combines traditional spectrum-based (SB) FL with deep learning and data-flow analysis. It takes the buggy statements returned by the SBFL model, detects the buggy hunks to be fixed at once, and expands a buggy statement $s$ in a hunk to include other suspicious statements around s. We design a two-tier, tree-based LSTM model that incorporates cycle training and uses a divide-and-conquer strategy to learn proper code transformations for fixing multiple statements in the suitable fixing context consisting of surrounding subtrees. We conducted several experiments to evaluate DEAR on three datasets: Defects4J (395 bugs), BigFix (+26k bugs), and CPatMiner (+44k bugs). On Defects4J dataset, DEAR outperforms the baselines from 42%-683% in terms of the number of auto-fixed bugs with only the top-1 patches. On BigFix dataset, it fixes 31–145 more bugs than existing DL-based APR models with the top-1 patches. On CPatMiner dataset, among 667 fixed bugs, there are 169 (25.3%) multi-hunk/multi-statement bugs. DEAR fixes 71 and 164 more bugs, including 52 and 61 more multi-hunk/multi-statement bugs, than the state-of-the-art, DL-based APR models.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{Li0N22,
  title = {DEAR},
  author = {Yi Li and Shaohua Wang and Tien N. Nguyen},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510177}
}