Commit 7a2559c5 authored by Kevin Bi's avatar Kevin Bi
Browse files

"Added documentation to the TarantulaMain program"

parent 5eb1ddbc
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -4,19 +4,26 @@ import java.util.Arrays;
import java.io.File;
import java.util.ArrayList;

/**************************************************************************
 * Main for tarantula calculation, takes 2 command line arguments
 * arg[1] - compact-cov-matrix.json file
 * arg[2] - package.name of test program
 * examples of the args are in comments next to the args indexes below 
 **************************************************************************/
 
public class TarantulaMain {
	 
	    public static void main(String[] args) throws ClassNotFoundException {
	    	
	        // create the Matrix Reader to get Test -- Stmt information
	        File f = new File(args[0]/*"/homes/iws/kevinb22/Downloads/triangle-mvn-compact-cov-matrix.json"*/);
	        covMatrixReader reader = new covMatrixReader(f);
	        File f = new File(args[0]); // "/abs/path/to/triangle-mvn-compact-cov-matrix.json"*
		 reader = new covMatrixReader(f);
	        Long testCountLong = reader.getTestCount();
	        String testCountString = testCountLong.toString();
	        int testCountInt = Integer.parseInt(testCountString);
	        
	        // create Runner class to get the failing cases from JUnit tests
	        Class testClass = Class.forName(args[1]/*"TarantulaCalculator.TriangleTest"*/);
	        Class testClass = Class.forName(args[1]); //"TarantulaCalculator.TriangleTest"
	        Runner r = new Runner(testClass);
	        r.determineFailCases();
	        ArrayList<Integer> fails = r.getFailCases();
@@ -49,7 +56,7 @@ public class TarantulaMain {
	        System.out.println("------------------------------------------------------------------");
	        displaySusp(calc.getSuspiciousness(), reader.getFirstLine());
	    }
	     
	    // display the confidence array for the program	     
	    public static void displayConf(double[] a, Long firstLine){
	        System.out.println("Confidence Array");
	        for(int i = 0; i < a.length; i++) {
@@ -57,6 +64,7 @@ public class TarantulaMain {
	        }
	    }
	     
	    // dispaly the susp. array for the program
	    public static void displaySusp(double[] a, Long firstLine){
	        System.out.println("Suspicion Array");
	        for(int i = 0; i < a.length; i++) {