arXiv:2610.25826cs.SEOct 2026

Manuscript Offprint

arXiv:2610.25826

From Finding to Fixing: How Useful is Fault Localization for Agentic Program Repair?

Xinyu Shi, Zhou Yang, An Ran Chen

XINYU SHI, University of Alberta, Canada

ZHOU YANG, University of Alberta, Canada

AN RAN CHEN, University of Alberta, Canada

Fault localization (FL) aims to identify code locations responsible for software failures and is commonly evaluated by how accurately it ranks known fault locations. Large language model (LLM) agents are changing program repair and are increasingly used to search and reason over repositories. Although recent LLM-based FL methods have improved localization accuracy, their impact on agentic repair remains unclear. To address this gap, we conduct a systematic empirical study of FL in agentic repair. We evaluate six recent FL methods on SWE-bench Verified and Defects4J with three LLMs under a common repair framework and analyze 16,248 repair trajectories. We also examine gold locations and bug-cause descriptions as forms of FL guidance across different repair contexts. The studied FL methods do not consistently improve repair success, and higher localization accuracy does not consistently lead to larger repair gains. Yet FL guides agents' early search and helps them reach relevant code sooner. Accurate locations can reduce repair token use by up to 39.2%, but current FL methods often consume more tokens than they save during repair. Experiments with gold guidance suggest that FL has greater potential when bug inputs contain fewer location clues. Providing bug causes can further improve repair success beyond locations alone. We also find that ground truth from a single reference patch does not fully capture the locations used by successful repairs. These findings help clarify the value of FL in agentic repair and inform future work on its design and evaluation.

CCS Concepts: • Software and its engineering → Software testing and debugging.

Additional Key Words and Phrases: fault localization, program repair, large language models

1 Introduction

Debugging software failures requires developers to understand what went wrong, locate relevant code, and determine a fix. Fault localization (FL) aims to identify code locations that may be responsible for a software failure. Given bug information such as failing tests or an issue description, FL methods rank candidate code locations by their likelihood of containing the fault. Earlier approaches [1, 15, 48] used program execution information, such as test coverage, or information retrieval between bug reports and source code. Learning-based methods [18, 20, 29] used features of the code and its behavior to learn how to rank candidate locations. More recent methods [7, 14, 16, 24] use large language models (LLMs) to interpret bug information, reason about program behavior, and identify suspicious code locations. Despite these methodological changes, FL is still commonly formulated as a retrieval and ranking problem: methods return suspicious files, methods, or lines, and are typically evaluated by how highly known fault locations are ranked, using metrics such as Top-N [16, 17, 24].

Meanwhile, LLMs and agents are changing software engineering workflows. LLM agents combine language models with tools and iterative interaction, allowing them to take actions, observe the results, and adjust their subsequent decisions [44]. In program repair, such agents can tackle repository-level tasks end to end [33, 36]. Starting from a bug report or failing test, an agent can locate relevant code, modify the implementation, and validate the resulting patch through testing [5, 42]. As agents are applied to an expanding range of software engineering tasks, they are increasingly becoming a common part of developers' coding workflows.

Authors' Contact Information: Xinyu Shi, University of Alberta, Edmonton, Canada, xshi12@ualberta.ca; Zhou Yang, University of Alberta, Edmonton, Canada, zy25@ualberta.ca; An Ran Chen, University of Alberta, Edmonton, Canada, anran6@ualberta.ca.

Shi et al.

However, the value of FL for agentic repair remains unclear, especially as agents can search for relevant code and make repairs within an end-to-end workflow. Existing FL studies still focus primarily on localization accuracy, with limited evaluation of how FL affects downstream agentic repair. Beyond repair outcomes, existing studies also rarely examine how FL guidance affects agent behavior during repair. More broadly, as agents take a more active role in repository exploration and repair, the role and value of FL in agentic repair deserve closer examination.

To address these gaps, we investigate FL in agentic repair from three perspectives: whether FL improves repair success, how its guidance affects the repair process, and when it provides additional value. We organize the study around three research questions:

• RQ1: Does FL improve agentic repair?

• RQ2: How does FL affect the agent’s repair process?

• RQ3: When does FL provide additional value for agentic repair?

Our study covers two representative FL settings. We reproduce six recent FL methods on SWE-bench Verified and Defects4J v3.0.1, covering issue-based and test-based localization, and evaluate them with three repair models under the same agentic repair framework. For each benchmark and repair model, we evaluate repair without FL and with each of the three corresponding FL methods. We first compare repair with and without FL guidance to determine whether localization improves repair success and whether stronger localization translates into larger repair gains. We then analyze 16,248 distinct repair trajectories across these settings to measure changes in repository navigation, use of localization guidance, responses to misleading locations, and resource consumption. We also complement this analysis with a manual study. Finally, we move beyond the common contexts in which FL is typically evaluated and examine its role under broader agentic repair settings. We study cases with fewer location clues in the issue, multimodal bug inputs, and larger, more distributed repairs, and further examine whether conventional reference locations adequately represent where successful agents actually make repairs.

Our results show a more nuanced relationship between FL and agentic repair than localization accuracy alone suggests. The studied FL methods do not consistently improve repair success. Across the 18 FL-repair settings, adding FL changes pass@1 by -4.45 to +0.40 percentage points relative to No-FL, with decreases in 17 settings. Higher localization accuracy does not consistently translate into larger repair gains. Even when FL guidance is completely misleading, agents can reassess it and often still reach relevant code. Nevertheless, FL strongly shapes agents' initial search and helps them reach relevant code earlier. Accurate locations reduce repair token use by up to 39.2%, but the overhead of existing FL methods often outweighs downstream token savings. Our experiments suggest that FL has greater potential when bug inputs contain fewer direct location clues and that bug-cause information can provide further repair gains beyond locations alone. Conventional FL ground truth does not fully capture the locations used by successful repairs. Together, these findings clarify the value and limitations of FL in agentic repair and provide implications for future research on its design and evaluation. In summary, we make the following contributions:

• Downstream evaluation of FL for agentic repair. We systematically evaluate six recent FL methods on two benchmarks with three backbone models under a common agentic repair framework. Our results show that these methods do not consistently improve repair success, and higher localization accuracy does not consistently translate into larger repair gains. These findings highlight the need to evaluate FL through its contribution to downstream repair.

• Understanding how FL affects agentic repair. Through large-scale trajectory analysis and manual inspection, we show that FL primarily shapes agents' early repository search and helps

Table 1. Overview of recent LLM-based FL methods.

MethodBug inputBenchmarkOutputAgentic repair eval.
AutoFL [16]Failing testDefects4J v1.0, BugsInPyMethod×
LLM4FL [25]Failing testDefects4J v2.0.0Method×
SoapFL [24]Failing testDefects4J v1.2.0Method×
FlexFL [41]Bug report/failing testDefects4J v2.0.0, GHRBMethod×
MemFL [45]Failing testDefects4J v1Method×
FaR-Loc [28]Failing testDefects4J v1.2.0/v2.0.0Method×
LocAgent [7]Issue descriptionSWE-bench Lite, LocBenchLine×
CoSIL [14]Issue descriptionSWE-bench Lite/VerifiedFunction×
OrcaLoca [46]Issue descriptionSWE-bench LiteFunction×
SHERLOC [32]Issue descriptionSWE-bench Lite/VerifiedLine✓
SWERank [11]Issue descriptionSWE-bench Lite, LocBenchFunction×
GraphLocator [19]Issue descriptionSWE-bench Lite, LocBench, Multi-SWE-bench (Java)Function✓

them reach relevant code sooner. Agents assess the suggested locations through further exploration and can move beyond misleading guidance. FL often reduces repair effort, but localization overhead frequently outweighs the downstream token savings.

  • Rethinking the value of FL for agentic repair. Experiments with gold guidance show that accurate locations can reduce repair token use, that localization provides greater value when bug inputs contain fewer location clues, and that bug-cause information can improve repair success beyond locations alone. We also find that conventional FL ground truth does not fully capture the locations used by successful repairs. These findings motivate on-demand localization, guidance that combines locations with diagnostic information, and evaluation that accounts for alternative repair locations.

References (13)