A Unified Debugging Approach via LLM-Based Multi-Agent Synergy

Cheryl Lee,Chunqiu Steven Xia,Longji Yang,Jen-tse Huang,Zhouruixin Zhu,Lingming Zhang,Michael R. Lyu
2024-10-23
Abstract:Software debugging is a time-consuming endeavor involving a series of steps, such as fault localization and patch generation, each requiring thorough analysis and a deep understanding of the underlying logic. While large language models (LLMs) demonstrate promising potential in coding tasks, their performance in debugging remains limited. Current LLM-based methods often focus on isolated steps and struggle with complex bugs. In this paper, we propose the first end-to-end framework, FixAgent, for unified debugging through multi-agent synergy. It mimics the entire cognitive processes of developers, with each agent specialized as a particular component of this process rather than mirroring the actions of an independent expert as in previous multi-agent systems. Agents are coordinated through a three-level design, following a cognitive model of debugging, allowing adaptive handling of bugs with varying complexities. Experiments on extensive benchmarks demonstrate that FixAgent significantly outperforms state-of-the-art repair methods, fixing 1.25$\times$ to 2.56$\times$ bugs on the repo-level benchmark, Defects4J. This performance is achieved without requiring ground-truth root-cause code statements, unlike the baselines. Our source code is available on <a class="link-external link-https" href="https://github.com/AcceptePapier/UniDebugger" rel="external noopener nofollow">this https URL</a>.
Software Engineering
What problem does this paper attempt to address?
This paper attempts to solve the complexity and efficiency problems encountered in the software debugging process. Specifically, current methods based on large - language models (LLMs) perform well in handling isolated debugging steps, but have limited performance when dealing with complex errors. In addition, the existing applications of multi - agent systems in debugging often imitate human collaboration patterns, which are not fully suitable for debugging tasks with strong logic and clear steps. To solve these problems, the author proposes FixAgent - a hierarchical multi - agent framework for unified software debugging. The main contributions of FixAgent are as follows: 1. **End - to - end Debugging Framework**: This is the first framework that covers the entire debugging process from start to finish, including steps such as fault location and patch generation. 2. **Simulating Developer Cognitive Processes**: Each agent focuses on a specific component in the debugging process, rather than simply imitating the behavior of independent experts. 3. **Three - layer Design**: Coordinate agents through a three - layer architecture, allowing adaptive processing according to the complexity of errors, thereby improving debugging efficiency. 4. **No Need for True Root - cause Code Statements**: Unlike baseline methods, FixAgent can fix more errors without relying on the true root - cause code. ### Formula Representation The paper does not involve complex mathematical, physical or chemical formulas, but for the sake of format consistency and accuracy, the following are the Markdown representations of some key concepts and techniques mentioned in the paper: - **Multi - agent Framework**: FixAgent adopts a hierarchical multi - agent coordination paradigm, where each agent is responsible for a specific cognitive state in the debugging process. \[ \text{FixAgent}=\{\text{Helper}, \text{RepoFocus}, \text{Summarizer}, \text{Slicer}, \text{Locator}, \text{Fixer}, \text{FixerPro}\} \] - **Three - layer Architecture**: - **L1**: Only contains Locator and Fixer, and deals with simple errors. - **L2**: Contains five agents (Slicer, Summarizer, Locator, Fixer, FixerPro), and deals with complex errors within a single file. - **L3**: Activates all seven agents, and deals with complex errors of cross - file dependencies and external information. ### Summary FixAgent aims to provide a more efficient and comprehensive software debugging solution through multi - agent collaboration, especially showing significant advantages in dealing with complex errors. Experimental results show that FixAgent significantly outperforms existing methods in multiple benchmark tests, especially on the Defects4J benchmark, fixing 1.25 to 2.56 times more errors. Hope this information can help you better understand the core problems and solutions of this paper. If you have more questions or need further explanation, please feel free to ask.