Less is More: Adaptive Program Repair with Bug Localization and Preference Learning

📅 2025-03-09
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the challenge in Automated Program Repair (APR) of simultaneously ensuring patch correctness, minimal modification, and semantic consistency. To this end, we propose Adaptive Program Repair (AdaPR)—a novel task—and AdaPatcher, a two-stage framework. In the first stage, a self-debugging Bug Locator precisely identifies defective locations; in the second stage, a location-aware Program Modifier generates minimally altered, semantically consistent patches via hybrid reference-based training and adaptive preference learning. Key contributions include: (i) the first formalization of the AdaPR task; (ii) the introduction of location-aware repair modeling; (iii) hybrid supervised training integrating reference patches and execution feedback; and (iv) adaptive preference modeling to dynamically prioritize correctness, minimality, and consistency. Evaluated on multiple standard benchmarks, AdaPatcher significantly outperforms state-of-the-art APR approaches, achieving substantial improvements across all three dimensions—correctness, minimality, and semantic consistency.

Technology Category

Application Category

📝 Abstract
Automated Program Repair (APR) is a task to automatically generate patches for the buggy code. However, most research focuses on generating correct patches while ignoring the consistency between the fixed code and the original buggy code. How to conduct adaptive bug fixing and generate patches with minimal modifications have seldom been investigated. To bridge this gap, we first introduce a novel task, namely AdaPR (Adaptive Program Repair). We then propose a two-stage approach AdaPatcher (Adaptive Patch Generator) to enhance program repair while maintaining the consistency. In the first stage, we utilize a Bug Locator with self-debug learning to accurately pinpoint bug locations. In the second stage, we train a Program Modifier to ensure consistency between the post-modified fixed code and the pre-modified buggy code. The Program Modifier is enhanced with a location-aware repair learning strategy to generate patches based on identified buggy lines, a hybrid training strategy for selective reference and an adaptive preference learning to prioritize fewer changes. The experimental results show that our approach outperforms a set of baselines by a large margin, validating the effectiveness of our two-stage framework for the newly proposed AdaPR task.
Problem

Research questions and friction points this paper is trying to address.

Adaptive Program Repair with minimal code modifications
Maintaining consistency between fixed and original buggy code
Accurate bug localization and adaptive patch generation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Two-stage approach for adaptive program repair
Bug Locator with self-debug learning
Program Modifier with location-aware repair learning
🔎 Similar Papers
No similar papers found.
Z
Zhenlong Dai
Zhejiang University
B
Bingrui Chen
Hohai University
Z
Zhuoluo Zhao
Guizhou University
X
Xiu Tang
Zhejiang University
Sai Wu
Sai Wu
Professor, Zhejiang University
Distributed DatabaseAI for DB
C
Chang Yao
Zhejiang University
Zhipeng Gao
Zhipeng Gao
Zhejiang University
software engineering
J
Jingyuan Chen
Zhejiang University