This repository contains the source code and the experimental results of the repair of Nopol on a subset of the Defects4J dataset. The subset consists of four open-source projects: Apache Commons Math 1 (106 bugs), Apache Commons Lang 2 (65 bugs), Jfreechart 3 (26 bugs) and Joda-time 4 (27 bugs).
The experiment is an adaption of the analysis done by Matias Martinez, Thomas Durieux, Romain Sommerard, Jifeng Xuan and Martin Monperrus (Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset).
- Download the Defects4J dataset.
- Follow the Defects4J Getting Started.
- Export Defects4J into your PATH:
PATH=$PATH:~/<defects4j_path>/framework/bin
- Checkout all bugs
for bug in $(seq 1 26); do defects4j checkout -p Chart -v ${bug}b -w libs/projects/chart/chart_${bug}; done
for bug in $(seq 1 65); do defects4j checkout -p Lang -v ${bug}b -w libs/projects/lang/lang_${bug}; done
for bug in $(seq 1 106); do defects4j checkout -p Math -v ${bug}b -w libs/projects/math/math_${bug}; done
for bug in $(seq 1 27); do defects4j checkout -p Time -v ${bug}b -w libs/projects/time/time_${bug}; done
- Edit the Defects4J-repair config:
src/python/core/Config.py
- Run
src/python/repair.py
- To process results run
src/python/processResults.py
usage: src/python/repair.py [-h] -project PROJECT -tool MODE -id ID
arguments:
-h, --help shows help message
-project PROJECT Which project (math, lang, time, chart, all)
-mode MODE Which repair mode (ranking, conditional, precondition)
-id ID Bug id