FixMiner: Mining Relevant Fix Patterns for Automated Program Repair
arXiv:1810.01791 · doi:10.1007/s10664-019-09780-z
Abstract
Patching is a common activity in software development. It is generally performed on a source code base to address bugs or add new functionalities. In this context, given the recurrence of bugs across projects, the associated similar patches can be leveraged to extract generic fix actions. While the literature includes various approaches leveraging similarity among patches to guide program repair, these approaches often do not yield fix patterns that are tractable and reusable as actionable input to APR systems. In this paper, we propose a systematic and automated approach to mining relevant and actionable fix patterns based on an iterative clustering strategy applied to atomic changes within patches. The goal of FixMiner is thus to infer separate and reusable fix patterns that can be leveraged in other patch generation systems. Our technique, FixMiner, leverages Rich Edit Script which is a specialized tree structure of the edit scripts that captures the AST-level context of the code changes. FixMiner uses different tree representations of Rich Edit Scripts for each round of clustering to identify similar changes. These are abstract syntax trees, edit actions trees, and code context trees. We have evaluated FixMiner on thousands of software patches collected from open source projects. Preliminary results show that we are able to mine accurate patterns, efficiently exploiting change information in Rich Edit Scripts. We further integrated the mined patterns to an automated program repair prototype, PARFixMiner, with which we are able to correctly fix 26 bugs of the Defects4J benchmark. Beyond this quantitative performance, we show that the mined fix patterns are sufficiently relevant to produce patches with a high probability of correctness: 81% of PARFixMiner's generated plausible patches are correct.
arXiv comment31 pages, 11 figures
References in corpus (12)
- Nopol: Automatic Repair of Conditional Statement Bugs in Java Programs
- Automatic Software Repair: a Bibliography
- TBar: Revisiting Template-based Automated Program Repair
- Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset
- Elixir: Effective object-oriented program repair
- Mining Software Repair Models for Reasoning on the Search Space of Automated Program Fixing
- Dissection of a Bug Dataset: Anatomy of 395 Patches from Defects4J
- Ultra-Large Repair Search Space with Automatically Mined Templates: the Cardumen Mode of Astor
- Dynamic Patch Generation for Null Pointer Exceptions using Metaprogramming
- iFixR: Bug Report driven Program Repair
- Automatically Extracting Instances of Code Change Patterns with AST Analysis
- Impact of Tool Support in Patch Construction
Cited by in corpus (17)
- Practical Program Repair in the Era of Large Pre-trained Language Models
- CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
- Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learning
- Keep the Conversation Going: Fixing 162 out of 337 bugs for $0.42 each using ChatGPT
- Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repair
- Enhanced Automated Code Vulnerability Repair using Large Language Models
- Revisiting the Plastic Surgery Hypothesis via Large Language Models
- Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning
- Hyperparameter Optimization for AST Differencing
- DrPlanner: Diagnosis and Repair of Motion Planners for Automated Vehicles Using Large Language Models
- T5APR: Empowering Automated Program Repair across Languages through Checkpoint Ensemble
- Learning the Relation between Code Features and Code Transforms with Structured Prediction
- Practical Program Repair via Preference-based Ensemble Strategy
- Test-based Patch Clustering for Automatically-Generated Patches Assessment
- STEAM: Simulating the InTeractive BEhavior of ProgrAMmers for Automatic Bug 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