TransRepair: Context-aware Program Repair for Compilation Errors
Xueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng, Xiaofei Xie, Kai Chen, Yang Liu
Abstract
Automatically fixing compilation errors can greatly raise the productivity of software development, by guiding the novice or AI programmers to write and debug code. Recently, learning-based program repair has gained extensive attention and became the stateof-the-art in practice. But it still leaves plenty of space for improvement. In this paper, we propose an end-to-end solution TransRepair to locate the error lines and create the correct substitute for a C program simultaneously. Superior to the counterpart, our approach takes into account the context of erroneous code and diagnostic compilation feedback. Then we devise a Transformer-based neural network to learn the ways of repair from the erroneous code as well as its context and the diagnostic feedback. To increase the effectiveness of TransRepair, we summarize 5 types and 74 fine-grained sub-types of compilations errors from two real-world program datasets and the Internet. Then a program corruption technique is developed to synthesize a large dataset with 1,821,275 erroneous C programs. Through the extensive experiments, we demonstrate that TransRepair outperforms the state-of-the-art in both single repair accuracy and full repair accuracy. Further analysis sheds light on the strengths and weaknesses in the contemporary solutions for future improvement.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CoCoNuT: combining context-aware neural translation models using ensemble for program repair cites DLFix: context-based code transformation learning for automated program repair
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- CURE: Code-Aware Neural Machine Translation for Automatic Program Repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
- CURE: Code-Aware Neural Machine Translation for Automatic Program Repair cites DLFix: context-based code transformation learning for automated program repair
- OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL Reachability cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites DLFix: context-based code transformation learning for automated program repair
Cited by top-tier papers7
- OctoPack: Instruction Tuning Code Large Language ModelsNiklas Muennighoff, Qian Liu, Armel Randy Zebaze, Qinkai Zheng et al.ICLR 2024 · 203 citations
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program RepairKai Huang, Xiangxin Meng, Jian Zhang, Yang Liu et al.ASE 2023 · 91 citations
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive LearningShangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng et al.ICSE 2023 · 56 citations
- Rust-lancet: Automated Ownership-Rule-Violation Fixing with Behavior PreservationWenzhang Yang, Linhai Song, Yinxing XueICSE 2024 · 6 citations
- OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL ReachabilityWenjie Zhang, Guancheng Wang, Junjie Chen, Yingfei Xiong et al.ASE 2023 · 4 citations
Builds on10
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
- CoCoNuT: combining context-aware neural translation models using ensemble for program repairThibaud Lutellier, Hung Viet Pham, Lawrence Pang, Yitong Li et al.ISSTA 2020 · 325 citations
- CURE: Code-Aware Neural Machine Translation for Automatic Program RepairNan Jiang, Thibaud Lutellier, Lin TanICSE 2021 · 267 citations
- DLFix: context-based code transformation learning for automated program repairYi Li, Shaohua Wang, Tien N. NguyenICSE 2020 · 201 citations
Related papers
- Graph-based, Self-Supervised Program Repair from Diagnostic FeedbackMichihiro Yasunaga, Percy LiangICML 2020 · 198 citations
- TLR: Codebase-Level C Memory Management Error Repair with Large Language ModelsXiao Cheng, Zhihao Guo, Huan Huo, Yulei SuiFSE 2026 · 1 citation
- MultiFix: Learning to Repair Multiple Errors by Optimal Alignment LearningHyeonTae Seo, Yo-Sub Han, Sang-Ki KoEMNLP Findings 2021 · 4 citations
- TFix: Learning to Fix Coding Errors with a Text-to-Text TransformerBerkay Berabi, Jingxuan He, Veselin Raychev, Martin T. VechevICML 2021 · 143 citations
- Neural Program Repair with Execution-based BackpropagationHe Ye, Matias Martinez, Martin MonperrusICSE 2022 · 146 citations
