Commit 900567ac authored by Kevin Bi's avatar Kevin Bi
Browse files

"Updated READM.md with the latest set of instructions, added headers onto both...

"Updated READM.md with the latest set of instructions, added headers onto both scripts and expanded them to work better in the repo"
parent afc2b741
Loading
Loading
Loading
Loading
+45 −18
Original line number Diff line number Diff line
@@ -6,17 +6,17 @@ as well as a test program(Triangle).
Test Program: Triangle
----------------------
Triangle.java is a short java program, there is a fault in line 18 of the program.
TestSuite.java is a suite with 33 tests for triangle, the command mvn test should report 4 failed tests
TestSuite.java is a suite with 33 tests for triangle, the command mvn test should report 4 failed tests.

GZoltar
-------
GZoltar is one of the fault localization tool in this repo, it can be used as a plugin on Eclipse, for this project we use
GZoltar is one of the fault localization tool in this repo, it can be used as a plugin on Eclipse, for this project 
the GZoltar jar file which will calculate the suspiciousness of lines, it is found in the lib dir. 

Tarantula
---------
Tarantula the second fault localization tool in this repo. For this project we obtain a Json format cov matrix of the program
and then calculate the suspiciousness using the TarantulaMain.java class.
Tarantula is the second fault localization tool in this repo. For this project tacoco is used to obtain a Json format cov matrix of the program
and then calculate suspiciousness of lines using TarantulaMain.java.

TarantulaMain requires several arguments to be run:
	- The cov-matrix in Json format
@@ -39,10 +39,11 @@ Getting started
	- mvn clean package

Evaluating bugs using GZoltar
1. Enter the script directory
	- cd script
-----------------------------
1. Enter the gzoltar directory
	- cd gzoltar

2. Enter the following command
2. Run Gzoltar: the Gzoltar jar file can be run with the following command
	- ./run-gzoltar ../triangle triangle target/classes/:target/test-classes
	- (Optional) ./run-gzoltar ../triangle triangle target/classes/:target/test-classes | grep "Triangle.java" will print only the suspiciousness for lines in Triangle

@@ -51,19 +52,45 @@ Evaluating bugs using GZoltar


Evaluating bugs using Tarantula
1. Run Tacoco
-------------------------------
1. Enter the fl-scripts dir: All the scripts to run tacoco are held here
	- cd fl-scripts

1. Run Tacoco: The run-tacoco script runs tacoco and creates cp.txt files in both the system-under-test dir and the tacoco dir 
	- ./run-tacoco /abs/path/to/repo/triangle /abs/path/to/repo/tacoco

2. Run Jacoco.exec Analyzer
2. Run Jacoco.exec Analyzer: The run-jacoco script creates the jacoco.exec file and the .json files in the tacoco dir
	- ./run-jacoco /abs/path/to/repo/triangle triangle /abs/path/to/repo/tacoco

3. Create a .class file for the Test program
	- cd /triange/path/to/TestSuite.java
	- javac TestSuite.java
	- mv TestSuite.class /abs/path/to/repo/tarantula
3. Run TarantulaMain: TarantulaMain requires two args(see the file for more details), the first is the absolute path to the cov-matrix.json file, the second is the name of the Test class, if the test program belongs to a package make sure to specify the package, ex: Triangle.TestSuite
	- java TarantulaMain /abs/path/to/repo/tacoco/triange-compact-cov-matrix.json TestSuite

4, Clean the tacoco dir: Run clean-tacoco in order to clean the dir so it can be reused, this means tacoco will have to be recompiled
	-./clean-tacoco
	- mvn clean (in tacoco)

Directory Structure
-------------------
The directory structure is as follows
	
	fault-localization-research
		|
		|--- fl-scripts:		Scripts that run tacoco and create the jacoco.exec
		|
		|--- gzoltar:			Scripts that run the gzoltar jar file
		|
		|--- lib:			Libraries used in the repo
		|
		|--- primitive-hamcrest:	Repo, used by tacoco
		|
		|--- tacoco:			Repo, used to obtain per-test line coverage information
		|
		|--- tarantula:			Source files to obtain the suspiciousness for lines in a program
		|
		|---triangle:			Test program


	
3. Run TarantulaMain 
	- java TarantulaMain /abs/path/to/repo/tacoco/triange-mcn-compact-cov-matrix.json TestSuite.class


+4 −0
Original line number Diff line number Diff line
#!/bin/bash
# This script removes the files that run-tacoco and clean-tacoco create

cd ../tacoco
rm cp.txt jacoco.exec *.json
rm -r target
rm -r lib
+2 −3
Original line number Diff line number Diff line
#!/bin/bash

# This script runs the GZoltar jar file, the args are defined as below
# java -jar com.gzoltar-0.0.10-jar-with-dependencies.jar <project directory> <packages to instrument or test packages to execute (separated by ',')> <class path: bin/target directory, librabries, etc (separated by ':')>

# $1 command line argument corresponds to project directory
# $2 command line argument corresponds to packages to instrument
# $3 command line argument corresponds class path