paperbot · PL 论文追踪

全部论文 待读 收藏

P2 ThinkRepair: Self-Directed Automated Program Repair

ThinkRepair:自导向的自动化程序修复
ISSTA Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis2024匹配度 2/10 · 该论文属于 LLM 驱动的自动程序修复(APR),虽涉及 PL+AI 和 LLM 作为工具,但核心目标是通过 CoT、少样本提示与交互提升修复效果,不属于静态分析、形式化验证、浮点程序分析或贝叶斯程序分析等用户核心方向。引用 56 inbox
Xin Yin, Chao Ni, Shaohua Wang, Zhenhao Li, Limin Zeng, Xiaohu Yang
crossref: 2026-09-12

AI 速览

一句话:提出自导向 LLM 修复框架 ThinkRepair,通过自动收集思维链与少样本交互来修复缺陷。

自动化程序修复虽已取得进展,但修复需要理解程序逻辑的缺陷仍有困难;LLM 方法又依赖高质量提示,人工构建成本高。本文提出自导向的 LLM 修复方法 ThinkRepair,包含收集与修复两阶段:收集阶段用思维链提示让 LLM 自动生成多种修复思路作为先验知识;修复阶段先为少样本学习选择示例,再自动与 LLM 交互,并可加入测试反馈。在 Defects4J 与 QuixBugs 上对比 12 个 SOTA APR:Defects4J V1.2 修复 98 个缺陷,较基线提升 27%~344.4%;V2.0 比 SOTA 多修 12~65 个;QuixBugs 上 Java 最多 31 个、Python 最多 21 个。

问题
现有 APR 对需要分析程序逻辑的缺陷修复能力有限,而基于 LLM 的方法依赖人工设计高质量提示,成本高且质量不稳定。
方法
ThinkRepair 分两阶段:用 Chain-of-Thought 提示自动收集修复思路作为预修复知识,并在修复时选择少样本示例、自动与 LLM 交互,可选加入测试反馈。
评估
在 Defects4J V1.2/V2.0 和 QuixBugs 上与 12 个 SOTA APR 对比,修复数量显著提升,如 Defects4J V1.2 修复 98 个缺陷。
原文摘要(Abstract)

Though many approaches have been proposed for Automated Program Repair (APR) and indeed achieved remarkable performance, they still have limitations in fixing bugs that require analyzing and reasoning about the logic of the buggy program. Recently, large language models (LLMs) instructed by prompt engineering have attracted much attention for their powerful ability to address many kinds of tasks including bug-fixing. However, the quality of the prompt will highly affect the ability of LLMs and manually constructing high-quality prompts is a costly endeavor. To address this limitation, we propose a self-directed LLM-based automated program repair, ThinkRepair, with two main phases: collection phase and fixing phase. The former phase automatically collects various chains of thoughts that constitute pre-fixed knowledge by instructing LLMs with the Chain-of-Thought (CoT) prompt. The latter phase targets fixing a bug by first selecting examples for few-shot learning and second automatically interacting with LLMs, optionally appending with feedback of testing information. Evaluations on two widely studied datasets (Defects4J and QuixBugs) by comparing ThinkRepair with 12 SOTA APRs indicate the priority of ThinkRepair in fixing bugs. Notably, ThinkRepair fixes 98 bugs and improves baselines by 27%∼344.4% on Defects4J V1.2. On Defects4J V2.0, ThinkRepair fixes 12∼65 more bugs than the SOTA APRs. Additionally, ThinkRepair also makes a considerable improvement on QuixBugs (31 for Java and 21 for Python at most).

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8506,
  title = {ThinkRepair: Self-Directed Automated Program Repair},
  author = {Xin Yin and Chao Ni and Shaohua Wang and Zhenhao Li and Limin Zeng and Xiaohu Yang},
  booktitle = {ISSTA},
  year = {2024},
  doi = {10.1145/3650212.3680359}
}