This repository is used to replicate the experiments of article "Detecting, Creating, Repairing, and Understanding Indivisible Multi-Hunk Bugs" on TBar.
If you want to learn more about TBar, please follow the original repository of TBar.
We change the a field isTestFixPatterns in edu.lu.uni.serval.tbar.AbstractFixer from false to true, so that it can generate more plausible patches. This makes it fairer to compare with other tools.
- JDK 1.8
- Python 3.8
- Defects4J 2.0.0
- CatenaD4J
- Timeout: 5h
None
Use the Dockerfile in ./Docker to create the docker image.
docker build -t tbar-env .This docker image includes Defects4J, CatenaD4J, JDK 1.8, and Python 3.8.
AlphaRepair requires the use of GPU, otherwise generating the patch part would be very slow.
docker run -it --name tbar tbar-env /bin/bashAt the root of this container, we clone the TBar repository.
cd /
git clone https://github.com/give-to/TBarAPI.git
cd TBarAPI/ && chmod +x *It takes several minutes to quickly test your installation. (Note: In quick test, the ochiai.ranking.txt in Chart_18_2 only contains one location! )
cp C4J_location/105SampleBugsResult/Chart_18_2/short.txt C4J_location/105SampleBugsResult/Chart_18_2/ochiai.ranking.txt
# Test your environment
python3 runTBarForCatenaD4J.py 0 0 /TBarAPI test.txt /defects4jAfter finishing the repair, the results are in folders: OUTPUT.
Note: If you do not get any results, you can go to /tbar_log/TBar.log for more information.
It may take about 22 days to finish the entire experiment. You can also modify 105_bugs_list.txt to determine the bugs to be fixed.
cp C4J_location/105SampleBugsResult/Chart_18_2/backup.txt C4J_location/105SampleBugsResult/Chart_18_2/ochiai.ranking.txt
rm -rf OUTPUT/
# Run the whole experiment
python3 runTBarForCatenaD4J.py 0 104 /TBarAPI 105_bugs_list.txt /defects4jAfter finishing the repair, the results are in folders: OUTPUT.
|--- README.md : user guidance
|--- C4J_location : Bug positions localized with GZoltar of CatenaD4J bugs
|--- C4J_results : Generated patches of CatenaD4J bugs
|--- D4J : Defects4J information
|--- Docker : Dockerfile
|--- Results : Generated patches of Defects4J bugs
|--- src : source code
|--- target : binary code