zuzkajelcicova / CS454-Automated_patching_using_GP

4 stars 0 forks source link

CS454-Automated_patching_using_GP

The project contains the following directories:

The system is currently divided into 2 main parts. Firstly, GZoltar file of a faulty program that will contain code lines and their likelihood of being faulty must be extracted. This file (gzoltar.csv) will be used by the rest of the system to execute the main genetic algorithm. Below are the two aforementioned steps.

1. Usage of GZoltar

Usage as Eclipse Plugin

1. Download Java 8 32 Bit and Eclipse Mars 32 bit
2. Follow steps mentioned here: http://www.gzoltar.com/eclipse-plugin.html
3. Open new project
4. Press CTRL + F5 to run GZoltar
5. Output files of Gzoltar are created in folder "gzoltar" in the project directory 

Usage as CLI

1. Use: "com.gzoltar-0.0.11-jar-with-dependencies.java" in fault_localization\fl-main\start-gzoltar
2. Run: "java -jar ./com.gzoltar-0.0.11-jar-with-dependencies.jar projectPath ProjectName classDirectory"
3. Run (Example): "java -jar ./com.gzoltar-0.0.11-jar-with-dependencies.jar ../src/triangle triangle target/classes/:target/test-classes"
4. Output files of Gzoltar are created in folder "gzoltar" in the project directory 

2. Running full system

In order to run the current version of the system, instructions below must be followed (precondition: GZoltar file has been obtained in the previous step).

1. Install SRCML https://www.srcml.org/#download for parsing the .java and .xml code
2. Run Main.java with the following papameters: 
   "faultyProgramName srcMlPath -p populationSize -t timeInMinutes -b noOfBugsToSolve -cpf classFolderPathOfFaultyProgram".

   A specific example can be seen below:
   GCD "C:\\Program Files\\srcML 0.9.5\\bin" -p 50 -t 90 -b 1 -cfp "C:\\Users\\admin\\git\\CS454-Automated_patching_using_GP\\out\\production\\CS454_AutomatedPatching

3. The potentially fixed program can be found in the src/ directory. Its name matches the faulty program name.