🤖 AI Summary
Existing automated program repair methods neglect the fault localization phase, limiting repair accuracy—particularly in large-scale projects. To address this, we propose BugCerberus, the first hierarchical defect localization framework designed specifically for large-scale codebases. It introduces a novel three-tier, fine-grained localization architecture—operating at the file, function, and statement levels—and employs three specialized large language models (LLMs), each tailored to one level, enabling tight coordination between localization and repair. Our method integrates intermediate representation analysis, multi-granularity context modeling, and hierarchical search. Experiments on SWE-bench-lite show that BugCerberus improves statement-level Top-1/3/5/10 localization accuracy by 16.5%, 5.4%, 10.2%, and 23.1%, respectively; when integrated with Agentless repair, end-to-end repair success increases by 17.4%. This work provides the first quantitative validation of the decisive impact of precise fault localization on overall repair effectiveness.
📝 Abstract
Automated issue fixing is a critical task in software debugging and has recently garnered significant attention from academia and industry. However, existing fixing techniques predominantly focus on the repair phase, often overlooking the importance of improving the preceding bug localization phase. As a foundational step in issue fixing, bug localization plays a pivotal role in determining the overall effectiveness of the entire process. To enhance the precision of issue fixing by accurately identifying bug locations in large-scale projects, this paper presents BugCerberus, the first hierarchical bug localization framework powered by three customized large language models. First, BugCerberus analyzes intermediate representations of bug-related programs at file, function, and statement levels and extracts bug-related contextual information from the representations. Second, BugCerberus designs three customized LLMs at each level using bug reports and contexts to learn the patterns of bugs. Finally, BugCerberus hierarchically searches for bug-related code elements through well-tuned models to localize bugs at three levels. With BugCerberus, we further investigate the impact of bug localization on the issue fixing. We evaluate BugCerberus on the widely-used benchmark SWE-bench-lite. The experimental results demonstrate that BugCerberus outperforms all baselines. Specifically, at the fine-grained statement level, BugCerberus surpasses the state-of-the-art in Top-N (N=1, 3, 5, 10) by 16.5%, 5.4%, 10.2%, and 23.1%, respectively. Moreover, in the issue fixing experiments, BugCerberus improves the fix rate of the existing issue fixing approach Agentless by 17.4% compared to the best baseline, highlighting the significant impact of enhanced bug localization on automated issue fixing.