GithubHelp home page GithubHelp logo

henryhchchc / arja Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yyxhdy/arja

0.0 1.0 0.0 12.93 MB

Multi-Objective GP for Automated Repair of Java

License: MIT License

Java 99.78% Lua 0.11% Makefile 0.11%

arja's Introduction

ARJA

ARJA is a new genetic programming (GP) based program repair approach for Java. ARJA is mainly characterized by 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).

If you use ARJA for academic purpose, please include the following citation:

Yuan Yuan and Wolfgang Banzhaf. 2018. ARJA: Automated repair of Java programs via multi-objective genetic programming. IEEE Transactions on Software Engineering (2018). https://doi.org/10.1109/TSE.2018.2874648

Requirements

  1. Java JDK 1.7
  2. Mac OS X or Linux

How to Run

Set Up

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.

  1. ../arja/src : the source code of the tool
  2. ../arja/bin : the compiled classes of the tool
  3. ../arja/lib : the dependences of the tool (including a number of .jar files)
  4. ../arja/external : the external project

Minimum Usage

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 buggy program are required.

  1. -DsrcJavaDir :  the path to the root directory of the source code
  2. -DbinJavaDir :  the path to the root directory of all the compiled classes of source code
  3. -DbinTestDir : the path to the root directory of all the compiled classes of test code
  4. -Ddependences : the paths to 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$ by default. $id$ is a randomly generated string containing four characters.

Advanced Usage

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 approach.

$ 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')

Similarly, the external project is compiled as follows:

$ cd external
$ rm -r bin
$ mkdir bin
$ javac -cp lib/*: -d bin $(find src -name '*.java')

Evaluation

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 https://github.com/yyxhdy/arja-supplemental

Contact

For questions and feedback, please contact [email protected]

arja's People

Contributors

yyxhdy avatar mmxyz avatar henryhchchc avatar tdurieux avatar jose avatar ywmsu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.