LLMs have garnered considerable attention for their potential to streamline Automated Program Repair (APR). LLM-based approaches can either insert the correct code or directly generate patches when provided with buggy methods. However, most of LLM-based APR methods rely on a single type of software information, without fully leveraging different software artifacts. Despite this, many LLM-based approaches do not explore which specific types of information best assist in APR. Addressing this gap is crucial for advancing LLM-based APR techniques. We propose DEVLoRe to use issue content (description and message) and stack error traces to localize buggy methods, then rely on debug information in buggy methods and issue content and stack error to localize buggy lines and generate plausible patches which can pass all unit tests. The results show that while issue content is particularly effective in assisting LLMs with fault localization and program repair, different types of software artifacts complement each other. By incorporating different artifacts, DEVLoRe successfully locates 49.3% and 47.6% of single and non-single buggy methods and generates 56.0% and 14.5% plausible patches for the Defects4J v2.0 dataset, respectively. This outperforms current state-of-the-art APR methods. The source code and experimental results of this work for replication are available at https://github.com/XYZboom/DEVLoRe.
翻译:大型语言模型(LLM)因其在简化自动化程序修复(APR)方面的潜力而受到广泛关注。基于LLM的方法在提供有缺陷的方法时,可以插入正确代码或直接生成补丁。然而,大多数基于LLM的APR方法仅依赖单一类型的软件信息,未能充分利用不同的软件制品。尽管如此,许多基于LLM的方法并未探究哪些特定类型的信息最能辅助APR。填补这一空白对于推进基于LLM的APR技术至关重要。我们提出DEVLoRe方法,利用问题内容(描述与消息)和堆栈错误轨迹定位缺陷方法,随后基于缺陷方法中的调试信息、问题内容及堆栈错误定位缺陷行并生成能通过所有单元测试的可行补丁。实验结果表明,虽然问题内容在辅助LLM进行缺陷定位和程序修复方面特别有效,但不同类型的软件制品具有互补性。通过整合多种制品,DEVLoRe在Defects4J v2.0数据集中成功定位了49.3%的单缺陷方法和47.6%的非单缺陷方法,并分别生成了56.0%和14.5%的可行补丁,其性能优于当前最先进的APR方法。本工作的源代码与可复现实验结果发布于https://github.com/XYZboom/DEVLoRe。