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。