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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Dai, Zhenlong, Chen, Bingrui, Zhao, Zhuoluo, Tang, Xiu, Wu, Sai, Yao, Chang, Gao, Zhipeng, Chen, Jingyuan
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910865358323712
author Dai, Zhenlong
Chen, Bingrui
Zhao, Zhuoluo
Tang, Xiu
Wu, Sai
Yao, Chang
Gao, Zhipeng
Chen, Jingyuan
author_facet Dai, Zhenlong
Chen, Bingrui
Zhao, Zhuoluo
Tang, Xiu
Wu, Sai
Yao, Chang
Gao, Zhipeng
Chen, Jingyuan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2503_06510
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Less is More: Adaptive Program Repair with Bug Localization and Preference Learning
Dai, Zhenlong
Chen, Bingrui
Zhao, Zhuoluo
Tang, Xiu
Wu, Sai
Yao, Chang
Gao, Zhipeng
Chen, Jingyuan
Software Engineering
Computation and Language
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.
title Less is More: Adaptive Program Repair with Bug Localization and Preference Learning
topic Software Engineering
Computation and Language
url https://arxiv.org/abs/2503.06510