Nopol: Automatic Repair of Conditional Statement Bugs in Java Programs

11/10/2018
by   Jifeng Xuan, et al.
0

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.

READ FULL TEXT

page 24

page 25

research
01/17/2019

Bears: An Extensible Java Bug Benchmark for Automatic Program Repair Studies

Benchmarks of bugs are essential to empirically evaluate automatic progr...
research
11/04/2018

Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset

Defects4J is a large, peer-reviewed, structured dataset of real-world Ja...
research
12/21/2017

ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programming

Recent empirical studies show that the performance of GenProg is not sat...
research
12/18/2018

Learning to Generate Corrective Patches using Neural Machine Translation

Bug fixing is generally a manually-intensive task. However, recent work ...
research
07/12/2019

iFixR: Bug Report driven Program Repair

Issue tracking systems are commonly used in modern software development ...
research
02/09/2022

Providing Real-time Assistance for Repairing Runtime Exceptions using Stack Overflow Posts

Runtime Exceptions (REs) are an important class of bugs that occur frequ...
research
08/11/2020

Localizing Patch Points From One Exploit

Automatic patch generation can significantly reduce the window of exposu...

Please sign up or login with your details

Forgot password? Click here to reset