Lune

ASE2022Top-tier venue

SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics

He Ye, Matias Martinez, Xiapu Luo, Tao Zhang, Martin Monperrus

Abstract

Learning-based program repair has achieved good results in a recent series of papers. Yet, we observe that the related work fails to repair some bugs because of a lack of knowledge about 1) the application domain of the program being repaired, and 2) the fault type being repaired. In this paper, we solve both problems by changing the learning paradigm from supervised training to self-supervised training in an approach called SelfAPR. First, SelfAPR generates training samples on disk by perturbing a previous version of the program being repaired, enforcing the neural model to capture project-specific knowledge. This is different from the previous work based on mined past commits. Second, SelfAPR executes all training samples and extracts and encodes test execution diagnostics into the input representation, steering the neural model to fix the kind of fault. This is different from the existing studies that only consider static source code as input. We implement SelfAPR and evaluate it in a systematic manner. We generate 1 039 873 training samples obtained by perturbing 17 open-source projects. We evaluate SelfAPR on 818 bugs from Defects4J, SelfAPR correctly repairs 110 of them, outperforming all the supervised learning repair approaches.

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.

34 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

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
  • Impact of Code Language Models on Automated Program Repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
  • Impact of Code Language Models on Automated Program Repair cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Impact of Code Language Models on Automated Program Repair cites CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
  • Impact of Code Language Models on Automated Program Repair cites DLFix: context-based code transformation learning for automated program repair
  • Impact of Code Language Models on Automated Program Repair cites A syntax-guided edit decoder for neural program repair
  • Impact of Code Language Models on Automated Program Repair cites Neural Program Repair with Execution-based Backpropagation
  • Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPT cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
  • Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPT cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPT cites CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
  • Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPT cites DLFix: context-based code transformation learning for automated program repair
  • Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPT cites A syntax-guided edit decoder for neural program repair
  • Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPT cites Neural Program Repair with Execution-based Backpropagation
  • 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
  • A syntax-guided edit decoder for neural program repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
  • A syntax-guided edit decoder for neural program repair cites DLFix: context-based code transformation learning for automated program repair
  • Neural Program Repair with Execution-based Backpropagation cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
  • Neural Program Repair with Execution-based Backpropagation cites CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
  • Neural Program Repair with Execution-based Backpropagation cites DLFix: context-based code transformation learning for automated program repair
  • Neural Program Repair with Execution-based Backpropagation cites A syntax-guided edit decoder for neural 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 Impact of Code Language Models on Automated Program Repair
  • 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 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
  • An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites A syntax-guided edit decoder for neural program repair
  • An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites Neural Program Repair with Execution-based Backpropagation
  • RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
  • RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
  • RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites DLFix: context-based code transformation learning for automated program repair
  • RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites A syntax-guided edit decoder for neural program repair
  • RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites Neural Program Repair with Execution-based Backpropagation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers34

  1. Impact of Code Language Models on Automated Program RepairNan Jiang, Kevin Liu, Thibaud Lutellier, Lin TanICSE 2023 · 164 citations
  2. Neural Program Repair with Execution-based BackpropagationHe Ye, Matias Martinez, Martin MonperrusICSE 2022 · 146 citations
  3. Automated Program Repair via Conversation: Fixing 162 out of 337 Bugs for $0.42 Each using ChatGPTChunqiu Steven Xia, Lingming ZhangISSTA 2024 · 105 citations
  4. 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
  5. RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program RepairWeishi Wang, Yue Wang, Shafiq Joty, Steven C. H. HoiFSE 2023 · 84 citations

Builds on16

  1. 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
  2. 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
  3. CURE: Code-Aware Neural Machine Translation for Automatic Program RepairNan Jiang, Thibaud Lutellier, Lin TanICSE 2021 · 267 citations
  4. A syntax-guided edit decoder for neural program repairQihao Zhu, Zeyu Sun, Yuan-an Xiao, Wenjie Zhang et al.FSE 2021 · 214 citations
  5. DLFix: context-based code transformation learning for automated program repairYi Li, Shaohua Wang, Tien N. NguyenICSE 2020 · 201 citations

Related papers

  1. KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program RepairNan Jiang, Thibaud Lutellier, Yiling Lou, Lin Tan et al.ICSE 2023 · 55 citations
  2. ITER: Iterative Neural Repair for Multi-Location PatchesHe Ye, Martin MonperrusICSE 2024 · 39 citations
  3. Towards Low-Resource Automatic Program Repair with Meta-Learning and Pretrained Language ModelsWeishi Wang, Yue Wang, Steven C. H. Hoi, Shafiq JotyEMNLP 2023 · 2 citations
  4. Improving Fault Localization and Program Repair with Deep Semantic Features and Transferred KnowledgeXiangxin Meng, Xu Wang, Hongyu Zhang, Hailong Sun et al.ICSE 2022 · 77 citations
  5. Self-Supervised Bug Detection and RepairMiltiadis Allamanis, Henry Jackson-Flux, Marc BrockschmidtNeurIPS 2021 · 145 citations
Dusk over the sea between two cliffs drawn in fine vertical lines