ARJA is a new genetic programming (GP) based program repair approach for Java. ARJA is mainly characterized with a novel patch representation for GP, multi-objective search, test filtering procedure, type matching and several strategies to reduce the search space. This tool provides the implementation of ARJA along with three previous notable repair approaches (i.e., GenProg, RSRepair and Kali).
- Java JDK 1.7
- Mac OS X or Linux
How to Run
First, clone ARJA to the local computer:
$ git clone https://github.com/yyxhdy/arja
There are four subdirectories in the root directory of the tool.
- ../arja/src : the source code of the tool
- ../arja/bin : the compiled classes of the tool
- ../arja/lib : the dependences of the tool (including a number of .jar files)
- ../arja/external : the external project
Enter into the root directory of the tool:
$ cd arja
Confirm that the current version of Java is JDK 1.7 and use the following command to run:
$ java -cp lib/*:bin us.msu.cse.repair.Main Arja -DsrcJavaDir path_to_directory_of_src_buggy \ -DbinJavaDir path_to_directory_of_binary_source_buggy \ -DbinTestDir path_to_directory_of_binary_test_buggy \ -Ddependences paths_to_dependences_buggy
"Arja" means that the repair approach ARJA is run. Alternatively, "GenProg", "RSRepair" and "Kali" can be used. Moreover, at least four parameters related with the bugyy program are required.
- -DsrcJavaDir : the path to the root directory of the source code
- -DbinJavaDir : the path to the root directory of all the compiled classes of source code
- -DbinTestDir : the path to the root directory of all the compiled classes of test code
- -Ddependences : the paths to the the dependences (jar files). If more than one, separated by ":"
In the above command, "path_to_directory_of_src_buggy" etc should be replaced with the actual absolute paths (the tool currently only supports absolute paths). All the test-suite adequate patches found by the approach are saved in the directory arja/patches_$id$.txt by default. $id$ is a randomly generated string containing four characters.
The tool provides the other parameters to configure the repair approaches. The following command can be used to list all the parameters (including the description) available for each repair apporach.
$ java -cp lib/*:bin us.msu.cse.repair.Main -listParameters
The following is an example to use more than four parameters:
$ java -cp lib/*:bin us.msu.cse.repair.Main Arja -DsrcJavaDir path_to_directory_of_src_buggy \ -DbinJavaDir path_to_directory_of_binary_source_buggy \ -DbinTestDir path_to_directory_of_binary_test_buggy \ -Ddependences paths_to_dependences_buggy \ -DpopulationSize value_of_population_size \ -DgzoltarDataDir path_to_directory_of_Gzoltar_output \
In this command, the parameter -DpopulationSize sets the population size of ARJA to "value_of_population_size"; the parameter -DgzoltarDataDir specifies the path to the root directory of the Gzoltar 1.6.2 output (see http://www.gzoltar.com/command-line.html).
How to Build
The users can also compile the tool themselves. First, enter into the root directory of the tool and clean the original binaries:
$ cd arja $ rm -r bin
Then, compile the source code of the tool, and the compiled classes are saved in the directory "bin":
$ mkdir bin $ javac -cp lib/*: -d bin $(find src -name '*.java')
Similarily, the external project is compiled as follows:
$ cd external $ rm -r bin $ mkdir bin $ javac -cp lib/*: -d bin $(find src -name '*.java')
Our implemented approaches in this tool, including ARJA, GenProg, RSRepair and Kali, have been evaluated on 224 bugs in Defects4J (https://github.com/rjust/defects4j).
The test-suite adequate patches generated by these repair approaches are available at http://github.com/yyxhdy/defects4j-patches
We manually evaluate the correctness of the patches generated by ARJA. The detailed analysis of the patch correctness is available at http://github.com/yyxhdy/defects4j-correctness
For questions and feedback, please contact firstname.lastname@example.org