Enhancing LLM-driven Program Repair through RAG and Test-Method Mapping
3
조회
0
다운로드
0
인용
0
참고문헌
키워드
초록
Automated Program Repair (APR) aims to automatically fix buggy programs, with recent advances in Large Language Models (LLMs)showing strong potential. However, existing methods often struggle to leverage contextual information and capture the relationshipsbetween buggy methods and failing test cases. This paper aims to enhance LLM-driven program repair by systematically integratingintelligent method-test mapping with retrieval-augmented generation to address these limitations. We present an LLM-driven frameworkwith three key components: first, a mapping strategy that links buggy methods to relevant test cases, next, retrieval-augmented generation(RAG) that incorporates semantically similar code examples, and lastly, an iterative feedback-driven generation process. We constructedthe framework using GPT-4o and evaluated it on 353 method-level bugs from Defects4J 1.2. Experimental results demonstrated that ourapproach efficiently repaired 181 bugs, outperforming the baseline methods through effective context utilization and guided patchgeneration.These results indicate that retrieval-enhanced contextual reasoning can substantially improve repair accuracy and scalability.
Abstract
Automated Program Repair (APR) aims to automatically fix buggy programs, with recent advances in Large Language Models (LLMs)showing strong potential. However, existing methods often struggle to leverage contextual information and capture the relationshipsbetween buggy methods and failing test cases. This paper aims to enhance LLM-driven program repair by systematically integratingintelligent method-test mapping with retrieval-augmented generation to address these limitations. We present an LLM-driven frameworkwith three key components: first, a mapping strategy that links buggy methods to relevant test cases, next, retrieval-augmented generation(RAG) that incorporates semantically similar code examples, and lastly, an iterative feedback-driven generation process. We constructedthe framework using GPT-4o and evaluated it on 353 method-level bugs from Defects4J 1.2. Experimental results demonstrated that ourapproach efficiently repaired 181 bugs, outperforming the baseline methods through effective context utilization and guided patchgeneration.These results indicate that retrieval-enhanced contextual reasoning can substantially improve repair accuracy and scalability.
