arXiv:2604.00167cs.SEcs.AI2026-04被引 1

研究代码修复中定位粒度的影响,发现函数级最有效。

A Study on the Impact of Fault localization Granularity for Repository-Scale Code Repair Tasks

论文配图:A Study on the Impact of Fault localization Granularity for Repository-Scale Code Repair Tasks
图 1 · 摘自论文原文
  • 通过修改框架,隔离粒度因素进行修复测试。
  • 函数级定位修复成功率最高,达72.3%。
  • 结果表明粒度选择应根据任务类型调整。

自动程序修复在仓库级任务中极具挑战性,涉及问题重现、故障定位、代码修复、测试与验证等多个环节。现有方法常将定位与修复分阶段进行,但定位粒度的影响尚未在仓库级场景中系统研究。本文提出一种框架,通过修改Agentless框架的定位阶段,获取真实定位数据并作为上下文输入修复阶段。实验基于SWE-Bench-Mini数据集,发现函数级粒度的修复率(72.3%)显著高于行级(58.1%)和文件级(49.6%)。然而深入分析显示,最优粒度可能依赖具体任务。本研究不追求提升现有技术,而是提供一种验证定位粒度影响的可行性方法,鼓励后续探索定位与修复之间的关系。

原文摘要 · Abstract (English)

Automatic program repair can be a challenging task, especially when resolving complex issues at a repository-level, which often involves issue reproduction, fault localization, code repair, testing and validation. Issues of this scale can be commonly found in popular GitHub repositories or datasets that are derived from them. Some repository-level approaches separate localization and repair into distinct phases. Where this is the case, the fault localization approaches vary in terms of the granularity of localization. Where the impact of granularity is explored to some degree for smaller datasets, not all isolate this issue from the separate question of localization accuracy by testing code repair under the assumption of perfect fault localization. To the best of the authors' knowledge, no repository-scale studies have explicitly investigated granularity under this assumption, nor conducted a systematic empirical comparison of granularity levels in isolation. We propose a framework for performing such tests by modifying the localization phase of the Agentless framework to retrieve ground-truth localization data and include this as context in the prompt fed to the repair phase. We show that under this configuration and as a generalization over the SWE-Bench-Mini dataset, function-level granularity yields the highest repair rate against line-level and file-level. However, a deeper dive suggests that the ideal granularity may in fact be task dependent. This study is not intended to improve on the state-of-the-art, nor do we intend for results to be compared against any complete agentic frameworks. Rather, we present a proof of concept for investigating how fault localization may impact automatic code repair in repository-scale scenarios. We present preliminary findings to this end and encourage further research into this relationship between the two phases.

代码修复故障定位自动化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。