Skip to content

Latest commit

 

History

History
107 lines (84 loc) · 3.5 KB

README.md

File metadata and controls

107 lines (84 loc) · 3.5 KB

SimFix

This repository is used to replicate the experiments of article "Detecting, Creating, Repairing, and Understanding Indivisible Multi-Hunk Bugs" on SimFix. If you want to learn more about SimFix, please follow the original repository of SimFix.

1. Modification

In order to use SimFix more flexibly, we have added a parameter to SimFix to indicate the number of generated plausible patches.

2. Environment

3. Experiment Setup

  • Timeout: 5h
  • Plausible patches number: 500

4. Excluded Bug

None

5. Installation

5.1 Create the docker image

Use the Dockerfile in ./Docker to create the docker image.

docker build -t simfix-env .

This docker image includes Defects4J, CatenaD4J, and JDK 1.8.

5.2 Create the container

docker run -it --name=simfix simfix-env /bin/bash

5.3 Clone the SimFix repository

At the root of this container, we clone the SimFix repository.

cd /
git clone https://github.com/BaiGeiQiShi/SimFixAPI.git

5.4 Install dependencies and Setup

After testing, we found that using pip in the Docker file might cause image creation to fail, so configuration inside the container is required.

cd ./SimFixAPI
chmod +x *
./setup.sh

6. Quick Test

It takes several minutes to quickly test your installation. (Note: In quick test, the ochiai.ranking.txt in Chart18b2 only contains one location!)

# Generate the patches
./start_simfix.sh

After finishing the repair, the results are in folders: log and patch.

  • log : debug output, including buggy statements already tried, patches and reference code snippet for correct patch generation.

  • patch : a single source file repaired by SimFix that can pass the test suite. In the source file, you can find the patch, which is formatted as (example of Chart18b2):

 // start of generated patch
if(index<=this.keys.size()){
rebuildIndex();
}
// end of generated patch
/* start of original code
        if (index < this.keys.size()) {
        rebuildIndex();
        }
 end of original code*/

7. Experiment Reproduction

It may take about 20 days to finish the entire experiment. If you want to fully replicate our experiments on SimFix, please first checkout the 105 bugs in Catena4J and then repair these 105 bugs. You can also modify 105_bugs.txt to determine the bugs to be fixed.

# Clean the quick test files
rm -rf 105_bugs_with_src/*

# Repair bugs
./checkout_105.sh  #checkout 105 bugs
./start_simfix.sh  #repair 105 bugs

After finishing the repair, you can also check the results in folders: log and patch.

8. Structure of the Directories

   |——./log/                          //repair log
   |——./105BugsFL/                    //FL results
   |——./105_bugs_with_src/            //buggy project directory
   |——105_bugs.txt                    //bug_id list(only fix bugs within this file)
   |——checkout_105.sh                 //download buggy project in 105_bugs.txt
   |——setup.sh                        //prepare environment
   |——start_simfix.sh                 //start repair (you can change timeout here)        

If you have any questions, you can go to the SimFix repository or create issues for more information.