SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics
arXiv:2203.12755 · doi:10.1145/3551349.3556926
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 projectspecific 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.
References in corpus (9)
- TBar: Revisiting Template-based Automated Program Repair
- CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
- Neural Program Repair with Execution-based Backpropagation
- On the Efficiency of Test Suite based Program Repair: A Systematic Assessment of 16 Automated Repair Systems for Java Programs
- Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations
- Is this Change the Answer to that Problem? Correlating Descriptions of Bug and Code Changes for Evaluating Patch Correctness
- Automated Repair of Programs from Large Language Models
- NatGen: Generative pre-training by "Naturalizing" source code
- Test2Vec: An Execution Trace Embedding for Test Case Prioritization
Cited by in corpus (9)
- Revisiting the Plastic Surgery Hypothesis via Large Language Models
- Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning
- RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repair
- Automated Test Case Repair Using Language Models
- Is this Change the Answer to that Problem? Correlating Descriptions of Bug and Code Changes for Evaluating Patch Correctness
- STEAM: Simulating the InTeractive BEhavior of ProgrAMmers for Automatic Bug Fixing
- Seeing is Fixing: Cross-Modal Reasoning with Multimodal LLMs for Visual Software Issue Fixing
- MultiMend: Multilingual Program Repair with Context Augmentation and Multi-Hunk Patch Generation
- Self-Bootstrapping Automated Program Repair: Using LLMs to Generate and Evaluate Synthetic Training Data for Bug Repair