paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Tare: Type-Aware Neural Program Repair

Tare:类型感知的神经程序修复
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 2/10 · 论文属于早期深度学习程序修复方向,利用类型规则减少不可类型化补丁,虽涉及 PL 与 ML 交叉,但未涉及用户核心关注的 LLM/Agent 与静态分析/形式化验证、浮点程序分析或贝叶斯程序分析。引用 62 inbox
Qihao Zhu, Zeyu Sun, Wenjie Zhang, Yingfei Xiong, Lu Zhang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出类型感知神经修复模型 Tare,用 T-Grammar 与 T-Graph 编码类型规则,减少不可类型化补丁。

基于深度学习的自动程序修复(APR)虽性能可观,却普遍生成大量无法通过类型检查的补丁,原因在于现有模型未考虑类型规则约束。本文提出类型感知模型 Tare 来学习类型规则,包含三个新组件:将类型信息融入标准文法的 T-Grammar、整合 AST 类型检查所需关键信息的代码表示 T-Graph,以及编码 T-Graph 并由 T-Grammar 引导生成补丁的类型感知神经修复方法。实验在三个基准上进行:Defects4J v1.2 的 393 个 bug、Defects4J v2.0 的 444 个额外 bug 以及 QuixBugs 的 40 个 bug。结果显示 Tare 分别修复 62、32 和 27 个 bug,在所有基准上均优于现有 APR 方法,且分析表明借助类型规则信息,它比现有 DL-based APR 方法倾向于生成更多可编译补丁。

问题
现有基于深度学习的自动程序修复模型忽略类型规则约束,导致生成大量无法通过类型检查的补丁。
方法
提出 Tare,通过 T-Grammar 将类型信息融入标准文法、用 T-Graph 表示 AST 类型检查所需关键信息,并以此编码并引导生成补丁。
评估
在 Defects4J v1.2、Defects4J v2.0 和 QuixBugs 三个基准上分别修复 62、32、27 个 bug,全面优于现有 APR 方法,并生成更多可编译补丁。
原文摘要(Abstract)

Automated program repair (APR) aims to reduce the effort of software development. With the development of deep learning, lots of DL-based APR approaches have been proposed using an encoder-decoder architecture. Despite the promising performance, these models share the same limitation: generating lots of untypable patches. The main reason for this phenomenon is that the existing models do not consider the constraints of code captured by a set of typing rules. In this paper, we propose, Tare, a type-aware model for neural program repair to learn the typing rules. To encode an individual typing rule, we introduce three novel components: (1) a novel type of grammars, T-Grammar, that integrates the type information into a standard grammar, (2) a novel representation of code, T-Graph, that integrates the key information needed for type checking an AST, and (3) a novel type-aware neural program repair approach, Tare, that encodes the T-Graph and generates the patches guided by T-Grammar. The experiment was conducted on three benchmarks, 393 bugs from Defects4J v1.2, 444 additional bugs from Defects4J v2.0, and 40 bugs from QuixBugs. Our results show that Tare repairs 62, 32, and 27 bugs on these benchmarks respectively, and outperforms the existing APR approaches on all benchmarks. Further analysis also shows that Tare tends to generate more compilable patches than the existing DL-based APR approaches with the typing rule information.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{ZhuSZXZ23,
  title = {Tare: Type-Aware Neural Program Repair},
  author = {Qihao Zhu and Zeyu Sun and Wenjie Zhang and Yingfei Xiong and Lu Zhang},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00126}
}