Rethinking Code Localization through Repair-Context Completeness: From Structural and Code Coverage Analysis to Context Augmentation
Abstract
Repository-level code localization is difficult because a single repair may span multiple distant source regions. Existing evaluations often report relevant hits or file coverage, but these metrics alone are insufficient to determine whether a bounded repair context contains all regions involved in a fix. We characterize this gap through repair-context completeness, defined as containment of the full *repair closure*, which consists of the pre-fix regions changed by a reference patch. Within this scope, we examine the assumption that directly using execution coverage improves line-level localization. Experiments across six dimensions show that execution evidence can expose more candidates without reliably assembling complete repair contexts under the tested policies. Accordingly, we introduce Complete-Fix Reachability–Realization (CFRR), a measurement framework that attributes incomplete contexts to failures at distinct stages of localization and context construction. Guided by this diagnosis, we propose TraceFill, which preserves the semantic localization base and uses repeat-consistent execution coverage to fill remaining context capacity. Our evaluation spans three models and starts with 1,100 instances from three datasets. TraceFill increases full repair-closure containment from 33.38% to 41.24% compared with the semantic baseline, a gain of 7.86 percentage points. In the downstream evaluation, repair success increases over Native for all three repair generators, with absolute gains of 0.60–1.69 percentage points and relative gains of 23.5–32.7%.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.