🤖 AI Summary
This work addresses the challenge that large language models (LLMs) often generate ineffective patches in automated program repair due to ambiguous or context-deficient bug reports. To mitigate this, the study introduces, for the first time, principles from software requirements engineering into LLM-driven repair by replacing raw bug descriptions with structured, problem-oriented requirement specifications. It further proposes an automated pipeline to construct, identify, and iteratively refine low-quality requirements, thereby guiding the LLM toward a more precise understanding of the defect. Evaluated on three widely used benchmarks, the approach achieves an average improvement of 17.40% in repair success rate over five state-of-the-art baselines, demonstrating the efficacy of structured requirement specifications in enhancing patch correctness.
📝 Abstract
Issue resolution aims to automatically generate patches from given issue descriptions and has attracted significant attention with the rapid advancement of large language models (LLMs). However, due to the complexity of software issues and codebases, LLM-generated patches often fail to resolve corresponding issues. Although various advanced techniques have been proposed with carefully designed tools and workflows, they typically treat issue descriptions as direct inputs and largely overlook their quality (e.g., missing critical context or containing ambiguous information), which hinders LLMs from accurate understanding and resolution. To address this limitation, we draw on principles from software requirements engineering and propose REAgent, a requirement-driven LLM agent framework that introduces issue-oriented requirements as structured task specifications to better guide patch generation. Specifically, REAgent automatically constructs structured and information-rich issue-oriented requirements, identifies low-quality requirements, and iteratively refines them to improve patch correctness. We conduct comprehensive experiments on three widely used benchmarks using two advanced LLMs, comparing against five representative or state-of-the-art baselines. The results demonstrate that REAgent consistently outperforms all baselines, achieving an average improvement of 17.40% in terms of the number of successfully-resolved issues (% Resolved).