From Defects to Demands: A Unified, Iterative, and Heuristically Guided LLM-Based Framework for Automated Software Repair and Requirement Realization

Alex, null, Liu, null, Vivian, null, Chi, null

arXiv.org Artificial Intelligence 

As software systems evolve, developers face a dual challenge: maintaining correctness by fixing bugs and continuously adapting functionality to meet new user demands. Traditional software engineering processes rely heavily on human developers to interpret requirements, fix errors, and ensure correctness against specifications. With the advancement of Large Language Models (LLMs) adept at code generation, the opportunity arises to shift portions of these responsibilities onto machine-driven processes. However, simply prompting an LLM to solve a complex programming task--be it eliminating a subtle bug or implementing a new feature--often falls short. Complex codebases exceed the model's context window, specification details are not always fully captured in a single prompt, and correctness requires iterative refinement guided by tests, analysis, and verification. This paper proposes a holistic, iterative framework that enables an LLM to evolve a codebase from an initial, potentially buggy state to one that satisfies not only pre-existing correctness criteria but also newly introduced feature demands. Key contributions include: 1. Unified Framework for Bug-to-Demand Resolution: We present a method by which the LLM iteratively refines code, starting from an imperfect state (with known or unknown bugs) and incrementally adjusting the codebase to meet a set of evolving functional and nonfunctional requirements introduced over time.