arXiv:2412.03905cs.SEcs.AI2024-12中稿 · publication in ACM…被引 10

融合多种软件信息提升大模型的缺陷定位与修复能力

Integrating Various Software Artifacts for Better LLM-based Bug Localization and Program Repair

  • 整合问题描述、错误堆栈和调试信息定位缺陷位置
  • 在Defects4J v2.0上实现49.3%单缺陷定位率与56.0%修复成功率
  • 适用于需要高精度修复的工程场景,尤其适合跨语言项目

大模型在自动化程序修复(APR)中展现出巨大潜力,但现有方法多依赖单一类型软件信息。本文提出DEVLoRe框架,融合问题描述、错误堆栈及调试信息,先定位有缺陷的方法,再精确定位出错行并生成可通过所有单元测试的修复补丁。实验表明,问题描述对缺陷定位和修复尤为有效,多源信息互补显著提升性能:在Defects4J v2.0数据集上,成功定位49.3%的单缺陷方法和47.6%的非单缺陷方法,并生成56.0%的合理补丁(14.5%通过全部测试)。该结果优于当前主流APR方法。在SWE-bench Lite上复现验证,成功解决9个独立问题,优于使用更先进模型的其他框架。研究还探讨了主流Python修复框架能否直接用于Java代码的问题。代码与实验结果已开源。

原文摘要 · Abstract (English)

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. Furthermore, we re-implemented and evaluated our framework, demonstrating its effectiveness in its effectiveness in resolving 9 unique issues compared to other state-of-the-art frameworks using the same or more advanced models on SWE-bench Lite.We also discussed whether a leading framework for Python code can be directly applied to Java code, or vice versa. The source code and experimental results of this work for replication are available at https://github.com/XYZboom/DEVLoRe.

程序修复大模型缺陷定位多源信息

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。