Nopol: Automatic Repair of Conditional Statement Bugs in Java Programs
arXiv:1811.04211 · doi:10.1109/TSE.2016.2560811
Abstract
We propose NOPOL, an approach to automatic repair of buggy conditional statements (i.e., if-then-else statements). This approach takes a buggy program as well as a test suite as input and generates a patch with a conditional expression as output. The test suite is required to contain passing test cases to model the expected behavior of the program and at least one failing test case that reveals the bug to be repaired. The process of NOPOL consists of three major phases. First, NOPOL employs angelic fix localization to identify expected values of a condition during the test execution. Second, runtime trace collection is used to collect variables and their actual values, including primitive data types and objected-oriented features (e.g., nullness checks), to serve as building blocks for patch generation. Third, NOPOL encodes these collected data into an instance of a Satisfiability Modulo Theory (SMT) problem, then a feasible solution to the SMT instance is translated back into a code patch. We evaluate NOPOL on 22 real-world bugs (16 bugs with buggy IF conditions and 6 bugs with missing preconditions) on two large open-source projects, namely Apache Commons Math and Apache Commons Lang. Empirical analysis on these bugs shows that our approach can effectively fix bugs with buggy IF conditions and missing preconditions. We illustrate the capabilities and limitations of NOPOL using case studies of real bug fixes.
IEEE Transactions on Software Engineering, 2016
References in corpus (9)
- Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset
- A Critical Review of "Automatic Patch Generation Learned from Human-Written Patches": Essay on the Problem Statement and the Evaluation of Automatic Software Repair
- Automated Fixing of Programs with Contracts
- Automatic Repair of Buggy If Conditions and Missing Preconditions with SMT
- Mining Software Repair Models for Reasoning on the Search Space of Automated Program Fixing
- Test Case Purification for Improving Fault Localization
- Do the Fix Ingredients Already Exist? An Empirical Inquiry into the Redundancy Assumptions of Program Repair Approaches
- Automatic Repair of Infinite Loops
- Dynamic Analysis can be Improved with Automatic Test Suite Refactoring
Cited by in corpus (62)
- TBar: Revisiting Template-based Automated Program Repair
- CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
- Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset
- Elixir: Effective object-oriented program repair
- FixMiner: Mining Relevant Fix Patterns for Automated Program Repair
- Sorting and Transforming Program Repair Ingredients via Deep Learning Code Similarities
- Identifying Patch Correctness in Test-Based Program Repair
- Neural Program Repair with Execution-based Backpropagation
- Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Review
- On the Efficiency of Test Suite based Program Repair: A Systematic Assessment of 16 Automated Repair Systems for Java Programs
- Dissection of a Bug Dataset: Anatomy of 395 Patches from Defects4J
- Bears: An Extensible Java Bug Benchmark for Automatic Program Repair Studies
- Ultra-Large Repair Search Space with Automatically Mined Templates: the Cardumen Mode of Astor
- Dynamic Patch Generation for Null Pointer Exceptions using Metaprogramming
- Deep Learning-based Software Engineering: Progress, Challenges, and Opportunities
- iFixR: Bug Report driven Program Repair
- SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics
- Automated Classification of Overfitting Patches with Statically Extracted Code Features
- How to Design a Program Repair Bot? Insights from the Repairnator Project
- A Comprehensive Study of Automatic Program Repair on the QuixBugs Benchmark
- Alleviating Patch Overfitting with Automatic Test Generation: A Study of Feasibility and Effectiveness for the Nopol Repair System
- Enhanced Automated Code Vulnerability Repair using Large Language Models
- Learning to Generate Corrective Patches using Neural Machine Translation
- Astor: Exploring the Design Space of Generate-and-Validate Program Repair beyond GenProg
- Repairnator patches programs automatically
- An Empirical Analysis of the Influence of Fault Space on Search-Based Automated Program Repair
- Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning
- Test Case Generation for Program Repair: A Study of Feasibility and Effectiveness
- ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programming
- RESTORE: Retrospective Fault Localization Enhancing Automated Program Repair
- A Comprehensive Study of Code-removal Patches in Automated Program Repair
- ENCORE: Ensemble Learning using Convolution Neural Machine Translation for Automatic Program Repair
- An Initial Step Towards Organ Transplantation Based on GitHub Repository
- Practical Program Repair via Preference-based Ensemble Strategy
- A Framework for Conditional Statement Technical Debt Identification and Description
- Test-based Patch Clustering for Automatically-Generated Patches Assessment
- Empirical Review of Java Program Repair Tools: A Large-Scale Experiment on 2,141 Bugs and 23,551 Repair Attempts
- STEAM: Simulating the InTeractive BEhavior of ProgrAMmers for Automatic Bug Fixing
- Mining Fix Patterns for FindBugs Violations
- Revisiting ssFix for Better Program Repair
- Fast and Precise On-the-fly Patch Validation for All
- Estimating the Potential of Program Repair Search Spaces with Commit Analysis
- DevReplay: Automatic Repair with Editable Fix Pattern
- Precise Condition Synthesis for Program Repair
- CTL* Verification and Synthesis using Existential Horn Clauses
- Validation of Automatically Generated Patches: An Appetizer
- Extracting Concise Bug-Fixing Patches from Human-Written Patches in Version Control Systems
- Interactive Patch Filtering as Debugging Aid
- Can Automated Program Repair Refine Fault Localization?
- You Cannot Fix What You Cannot Find! An Investigation of Fault Localization Bias in Benchmarking Automated Program Repair Systems
- Fairness-guided SMT-based Rectification of Decision Trees and Random Forests
- FLACOCO: Fault Localization for Java based on Industry-grade Coverage
- Production-Driven Patch Generation and Validation
- AVATAR : Fixing Semantic Bugs with Fix Patterns of Static Analysis Violations
- Practical Program Repair via Bytecode Mutation
- Obstacles in Fully Automatic Program Repair: A survey
- Tea: Program Repair Using Neural Network Based on Program Information Attention Matrix
- Towards the quality improvement of cross-platform mobile applications
- When Automated Program Repair Meets Regression Testing -- An Extensive Study on 2 Million Patches
- Show Me Why It's Correct: Saving 1/3 of Debugging Time in Program Repair with Interactive Runtime Comparison
- Self-Bootstrapping Automated Program Repair: Using LLMs to Generate and Evaluate Synthetic Training Data for Bug Repair
- Attention Please: Consider Mockito when Evaluating Newly Proposed Automated Program Repair Techniques