Commit 9c71515d authored by Kevin Bi's avatar Kevin Bi
Browse files

"Added scripts to automate fault localization tools: Gzolter, Tacoco"

parent 03319b89
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
#!/bin/bash

rm cp.txt jacoco.exec *.json

fl-scripts/run-gzoltar

0 → 100755
+11 −0
Original line number Diff line number Diff line
#!/bin/bash

#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

java -jar /homes/iws/kevinb22/Documents/ExampleProject/com.gzoltar-0.0.11-jar-with-dependencies.jar $1 $2 $3 

fl-scripts/run-jacoco

0 → 100755
+16 −0
Original line number Diff line number Diff line
#!/bin/bash

# NOTE do not include an ending backslash for any of the command line arg
#$1 command line arg, absolute path of system-under-test's root 
#$2 command line arg, refers to the name of the file/program that is going to be compacted
#$3 command line arg, refers to the absolute path file of the coverage-data-file 

mvn -q exec:java -Panalyzer -Dtacoco.sut=$1 -Dtacoco.json=${2}-compact.json -Dtacoco.exec=jacoco.exec -Dtacoco.pp -Dtacoco.fmt=COMPACT
echo ${2}-compact.json


FILEPATH=${3}/${2}-compact.json
echo $FILEPATH
mvn -q exec:java -Preader -Dtacoco.json="${FILEPATH}"

fl-scripts/run-tacoco

0 → 100755
+23 −0
Original line number Diff line number Diff line
#!/bin/bash

# $1 command line argument refers to absolute class path of the dir under test
# $2 command line argument refers to absolute class path of the tacoco dir
# run as ./run-tacoco absolute/path/of/your/project/root absolute/path/of/tacoco/root
# note how there are no ending forward slashes at the end of the paths

cd $1
mvn dependency:build-classpath -Dmdep.outputFile="cp.txt"
export CLASSPATH=`cat cp.txt`:$CLASSPATH
echo $CLASSPATH
export CLASSPATH=$1/target/test-classes:$1/target/classes:$CLASSPATH
echo $CLASSPATH

cd $2
mvn dependency:build-classpath -Dmdep.outputFile="cp.txt"
export CLASSPATH=`cat cp.txt`:$CLASSPATH
echo $CLASSPATH
export CLASSPATH=$2/target/test-classes:$2/target/classes:$CLASSPATH
echo $CLASSPATH
mvn dependency:copy-dependencies -DoutputDirectory=lib
java -javaagent:lib/org.jacoco.agent-0.7.4.201502262128-runtime.jar=destfile=jacoco.exec,dumponexit=false org.spideruci.tacoco.TacocoRunner $1/target/test-classes