EUVIMEDEUVIMED entdecken
Crossref

ContrastRepair : Enhancing Conversation-Based Automated Program Repair via Contrastive Test Case Pairs

Jiaolong Kong, Xiaofei Xie, Mingfei Cheng, Shangqing Liu, Xiaoning Du, Qi Guo

ACM Transactions on Software Engineering and Methodology · 30.11.2025 · 34 (8) · 1-31

DOI: 10.1145/3719345 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 03.10.2025. Verfasst von Jiaolong Kong und 5 weiteren Autor:innen. Die Arbeit wurde bisher 33-mal zitiert (Crossref) und nennt 85 Literaturangaben. Gefördert von: National Research Foundation, Cyber Security Agency.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Automated Program Repair (APR) aims to automatically generate patches for rectifying software bugs. Recent strides in Large Language Models (LLM), such as ChatGPT, have yielded encouraging outcomes in APR, especially within the conversation-driven APR framework. Nevertheless, the efficacy of conversation-driven APR is contingent on the quality of the feedback information. In this article, we propose ContrastRepair , a novel conversation-based APR approach that augments conversation-driven APR by providing LLMs with contrastive test pairs. A test pair consists of a failing test and a passing test, which offer contrastive feedback to the LLM. Our key insight is to minimize the difference between the generated passing test and the given failing test, which can better isolate the root causes of bugs. By providing such informative feedback, ContrastRepair enables the LLM to produce effective bug fixes. The implementation of ContrastRepair is based on the state-of-the-art LLM, ChatGPT, and it iteratively interacts with ChatGPT until plausible patches are generated. We evaluate ContrastRepair on multiple benchmark datasets, including Defects4J, QuixBugs, and HumanEval-Java. The results demonstrate that ContrastRepair significantly outperforms existing methods, achieving a new state-of-the-art in program repair. For instance, among Defects4J 1.2 and 2.0, ContrastRepair correctly repairs 143 out of all 337 bug cases, while the best-performing baseline fixes 124 bugs.

Förderung

  • National Research Foundation
  • Cyber Security Agency

Zitieren

APA

Kong, J., Xie, X., Cheng, M., Liu, S., Du, X., & Guo, Q. (2025). ContrastRepair : Enhancing Conversation-Based Automated Program Repair via Contrastive Test Case Pairs. ACM Transactions on Software Engineering and Methodology, 34(8), 1-31. https://doi.org/10.1145/3719345

Vancouver

Kong J, Xie X, Cheng M, Liu S, Du X, Guo Q. ContrastRepair : Enhancing Conversation-Based Automated Program Repair via Contrastive Test Case Pairs. ACM Transactions on Software Engineering and Methodology. 2025;34(8):1-31. doi:10.1145/3719345

BibTeX
@article{Kong2025,
  author = {Kong, Jiaolong and Xie, Xiaofei and Cheng, Mingfei and Liu, Shangqing and Du, Xiaoning and Guo, Qi},
  title = {ContrastRepair : Enhancing Conversation-Based Automated Program Repair via Contrastive Test Case Pairs},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2025},
  volume = {34},
  number = {8},
  pages = {1--31},
  doi = {10.1145/3719345}
}
Kostenlos starten →