import java.io.File; import java.io.IOException; import java.nio.channels.FileChannel; import java.io.FileInputStream; import java.nio.MappedByteBuffer; import java.nio.charset.Charset; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; public class Score{ static class ClassResult{ // times in milli seconds public int genTime, execTime, numTestCases; public int lines, linesCovered, instructions, instructionsCovered, branches, branchesCovered, methods, methodsCovered, cbmGenerated, cbmKilled, ncmGenerated, ncmKilled, mmGenerated, mmKilled, imGenerated, imKilled, inmGenerated, inmKilled, rvmGenerated, rvmKilled, vmcmGenerated, vmcmKilled, mutations, mutationsCovered; public String name; public double icov, lcov, mthdcov, bcov, mcov; // creates ClassResult by parsing a line public static ClassResult fromLine(String line){ String[] columns = line.split(";"); if(columns.length != 26) throw new IllegalArgumentException("Wrong number of columns"); ClassResult ret = new ClassResult(); try{ ret.name = columns[0]; ret.genTime = Integer.parseInt(columns[1]); ret.numTestCases = Integer.parseInt(columns[2]); ret.execTime = Integer.parseInt(columns[3]); ret.cbmGenerated = Integer.parseInt(columns[4]); ret.cbmKilled = Integer.parseInt(columns[5]); ret.ncmGenerated = Integer.parseInt(columns[6]); ret.ncmKilled = Integer.parseInt(columns[7]); ret.mmGenerated = Integer.parseInt(columns[8]); ret.mmKilled = Integer.parseInt(columns[9]); ret.imGenerated = Integer.parseInt(columns[10]); ret.imKilled = Integer.parseInt(columns[11]); ret.inmGenerated = Integer.parseInt(columns[12]); ret.inmKilled = Integer.parseInt(columns[13]); ret.rvmGenerated = Integer.parseInt(columns[14]); ret.rvmKilled = Integer.parseInt(columns[15]); ret.vmcmGenerated = Integer.parseInt(columns[16]); ret.vmcmKilled = Integer.parseInt(columns[17]); ret.instructions = Integer.parseInt(columns[18]); ret.instructionsCovered = Integer.parseInt(columns[19]); ret.branches = Integer.parseInt(columns[20]); ret.branchesCovered = Integer.parseInt(columns[21]); ret.methods = Integer.parseInt(columns[22]); ret.methodsCovered = Integer.parseInt(columns[23]); ret.lines = Integer.parseInt(columns[24]); ret.linesCovered = Integer.parseInt(columns[25]); ret.mutations = ret.cbmGenerated + ret.ncmGenerated + ret.mmGenerated + ret.imGenerated + ret.inmGenerated + ret.rvmGenerated + ret.vmcmGenerated; ret.mutationsCovered = ret.cbmKilled + ret.ncmKilled + ret.mmKilled + ret.imKilled + ret.inmKilled + ret.rvmKilled + ret.vmcmKilled; ret.icov = ratio(ret.instructionsCovered, ret.instructions); ret.lcov = ratio(ret.linesCovered, ret.lines); ret.bcov = ratio(ret.branchesCovered, ret.branches); ret.mcov = ratio(ret.mutationsCovered, ret.mutations); ret.mthdcov = ratio(ret.methodsCovered, ret.methods); }catch(NumberFormatException nfe){ throw new IllegalArgumentException("A column has a wrong data format!"); } return ret; } public String toString(){ /* return name + " = genTime: " + genTime + " execTime: " + execTime + " iCov: " + iCov + " bCov: " + branchCov + " mutCov: " + mutationCov + " tests: " + numTestCases; */ return ""; } } // contains aggregated results of an entire run static class RunResult{ private static final double w_t = 1.0, w_m = 4.0, w_b = 2.0, w_i = 1.0; // weights public int totalPrepTime; public ClassResult[] classResults; public double avgBCov = 0.0, avgICov = 0.0, avgMCov = 0.0, avgLCov = 0.0, avgMthdCov = 0.0; public int branches = 0, methods = 0, lines = 0, mutations = 0, instructions = 0; public int coveredBranches = 0, coveredMethods = 0, coveredLines = 0, coveredMutations = 0, coveredInstructions = 0; public int totalTestCases = 0; public int genTime = 0, runTime = 0; public double avgGenTime = 0.0, avgRunTime = 0.0; public int cbmGenerated, cbmKilled, ncmGenerated, ncmKilled, mmGenerated, mmKilled, imGenerated, imKilled, inmGenerated, inmKilled, rvmGenerated, rvmKilled, vmcmGenerated, vmcmKilled; public double score(){ int totalGenTime = 0, totalExecTime = 0; double sumBranchCov = 0.0, sumMutationCov = 0.0, sumInstructionCov = 0.0; for(ClassResult cr : classResults){ totalGenTime += cr.genTime; totalExecTime += cr.execTime; sumInstructionCov += cr.icov; sumBranchCov += cr.bcov; sumMutationCov += cr.mcov; } return w_i * sumInstructionCov + w_b * sumBranchCov + w_m * sumMutationCov - w_t * (totalPrepTime + totalGenTime + totalExecTime) / 3600000.0; } public static RunResult fromTranscript(String transcriptString){ String lines[] = transcriptString.split("\n"); if(lines.length < 4) throw new IllegalArgumentException("Two few lines in transcript!"); RunResult ret = new RunResult(); ret.totalPrepTime = Integer.parseInt(lines[1].split(":")[1].trim()); ret.classResults = new ClassResult[lines.length - 3]; for(int i = 3; i < lines.length; i++) ret.classResults[i - 3] = ClassResult.fromLine(lines[i]); ret.aggregate(); return ret; } private void aggregate(){ for(ClassResult cr : classResults){ avgBCov += cr.bcov; avgICov += cr.icov; avgMCov += cr.mcov; avgLCov += cr.lcov; avgMthdCov += cr.mthdcov; branches += cr.branches; methods += cr.methods; lines += cr.lines; mutations += cr.mutations; instructions += cr.instructions; coveredBranches += cr.branchesCovered; coveredMethods += cr.methodsCovered; coveredLines += cr.linesCovered; coveredMutations += cr.mutationsCovered; coveredInstructions += cr.instructionsCovered; totalTestCases += cr.numTestCases; genTime += cr.genTime; runTime += cr.execTime; cbmGenerated += cr.cbmGenerated; cbmKilled += cr.cbmKilled; ncmGenerated += cr.ncmGenerated; ncmKilled += cr.ncmKilled; mmGenerated += cr.mmGenerated; mmKilled += cr.mmKilled; imGenerated += cr.imGenerated; imKilled += cr.imKilled; inmGenerated += cr.inmGenerated; inmKilled += cr.inmKilled; rvmGenerated += cr.rvmGenerated; rvmKilled += cr.rvmKilled; vmcmGenerated += cr.vmcmGenerated; vmcmKilled += cr.vmcmKilled; } assert((cbmGenerated + ncmGenerated + mmGenerated + imGenerated + inmGenerated + rvmGenerated + vmcmGenerated) == mutations); assert((cbmKilled + ncmKilled + mmKilled + imKilled + inmKilled + rvmKilled + vmcmKilled) == coveredMutations); avgBCov /= classResults.length; avgICov /= classResults.length; avgMCov /= classResults.length; avgLCov /= classResults.length; avgMthdCov /= classResults.length; avgGenTime = (double) genTime / (double) classResults.length; avgRunTime = (double) runTime / (double) classResults.length; } public String toString(){ StringBuilder sb = new StringBuilder("\n"); sb.append(String.format("%s\n", new String(new char[160]).replace("\0", "-"))); sb.append(String.format("%-65s %-10s %-10s %-10s %-15s %-15s %-15s\n", "ClassName", "JUFiles", "t_gen", "t_exec", "% InstrCov", "% BranchCov", "% MutationCov")); sb.append(String.format("%s\n", new String(new char[160]).replace("\0", "-"))); for(ClassResult cr : classResults){ sb.append(String.format("%-65s %-10d %-10.2f %-10.2f %-15.2f %-15.2f %-15.2f\n", cr.name, cr.numTestCases, cr.genTime / 1000.0 / 60.0, cr.execTime / 1000.0 / 60.0, cr.icov * 100.0, cr.bcov * 100.0, cr.mcov * 100.0)); } sb.append("\n\n"); String classes = sb.toString(); String aggregations = String.format( "total number of CUTs: %d\n" + "total number of test cases (files): %d\n" + "average per class instruction coverage: %f %%\n" + "average per class line coverage: %f %%\n" + "average per class branch coverage: %f %%\n" + "average per class method coverage: %f %%\n" + "average per class mutation coverage: %f %%\n" + "overall covered instructions: %d / %d (%f %%)\n" + "overall covered lines: %d / %d (%f %%)\n" + "overall covered branches: %d / %d (%f %%)\n" + "overall covered methods: %d / %d (%f %%)\n" + "overall covered mutations: %d / %d (%f %%)\n" + "overall covered ConditionalBoundaryMutations: %d / %d (%f %%)\n" + "overall covered NegateConditionalMutations: %d / %d (%f %%)\n" + "overall covered MathMutations: %d / %d (%f %%)\n" + "overall covered IncrementMutations: %d / %d (%f %%)\n" + "overall covered InvertNegativeMutations: %d / %d (%f %%)\n" + "overall covered ReturnValueMutations: %d / %d (%f %%)\n" + "overall covered VoidMethodCallMutations: %d / %d (%f %%)\n" + "preparation time: %f seconds\n" + "average per class generation time: %f seconds\n" + "average per class execution time: %f seconds\n" + "total generation time: %f seconds\n" + "total execution time: %f seconds\n" + "overall score: >>> %f <<<\n", classResults.length, totalTestCases, avgICov * 100.0, avgLCov * 100.0, avgBCov * 100.0, avgMthdCov * 100.0, avgMCov * 100.0, coveredInstructions, instructions, ratio(coveredInstructions, instructions) * 100.0, coveredLines, lines, ratio(coveredLines, lines) * 100.0, coveredBranches, branches, ratio(coveredBranches, branches) * 100.0, coveredMethods, methods, ratio(coveredMethods, methods) * 100.0, coveredMutations, mutations, ratio(coveredMutations, mutations) * 100.0, cbmKilled, cbmGenerated, ratio(cbmKilled, cbmGenerated) * 100.0, ncmKilled, ncmGenerated, ratio(ncmKilled, ncmGenerated) * 100.0, mmKilled, mmGenerated, ratio(mmKilled, mmGenerated) * 100.0, imKilled, imGenerated, ratio(imKilled, imGenerated) * 100.0, inmKilled, inmGenerated, ratio(inmKilled, inmGenerated) * 100.0, rvmKilled, rvmGenerated, ratio(rvmKilled, rvmGenerated) * 100.0, vmcmKilled, vmcmGenerated, ratio(vmcmKilled, vmcmGenerated) * 100.0, (double) totalPrepTime / 1000.0, avgGenTime / 1000.0, avgRunTime / 1000.0, genTime / 1000.0, runTime / 1000.0, score()); return classes + aggregations; } } public static class ExperimentResult{ public RunResult[] runResults; public double totalPrepTime; public double avgBCov = 0.0, avgICov = 0.0, avgMCov = 0.0, avgLCov = 0.0, avgMthdCov = 0.0; public int branches = 0, methods = 0, lines = 0, mutations = 0, instructions = 0; public double coveredBranches = 0, coveredMethods = 0, coveredLines = 0, coveredMutations = 0, coveredInstructions = 0; public double totalTestCases = 0; public double genTime = 0, runTime = 0; public double avgGenTime = 0.0, avgRunTime = 0.0; public double cbmKilled, ncmKilled, mmKilled, imKilled, inmKilled, rvmKilled, vmcmKilled; public int cbmGenerated, ncmGenerated, mmGenerated, imGenerated, inmGenerated, rvmGenerated, vmcmGenerated; public List aggClassResults; private static class AggregatedClassResult{ public double files, gentime, exectime, icov, bcov, mcov; public String name; } public static ExperimentResult fromTranscripts(String[] transcriptStrings){ if(transcriptStrings.length == 0) throw new IllegalArgumentException("Did not find any data!"); ExperimentResult ret = new ExperimentResult(); ret.runResults = new RunResult[transcriptStrings.length]; for(int i = 0; i < transcriptStrings.length; i++) ret.runResults[i] = RunResult.fromTranscript(transcriptStrings[i]); ret.aggregate(); ret.aggregateClassResults(); return ret; } public double score(){ double ret = 0.0; for(RunResult r : runResults) ret += r.score(); return ret / runResults.length; } private void aggregateClassResults(){ Map> perClass = new HashMap>(); aggClassResults = new ArrayList(); for(RunResult rr : runResults){ for(ClassResult cr : rr.classResults){ if(!perClass.containsKey(cr.name)) perClass.put(cr.name, new ArrayList()); perClass.get(cr.name).add(cr); } } for(ClassResult cr : runResults[0].classResults){ AggregatedClassResult acr = new AggregatedClassResult(); acr.name = cr.name; for(ClassResult pcr : perClass.get(cr.name)){ acr.files += pcr.numTestCases; acr.gentime += pcr.genTime; acr.exectime += pcr.execTime; acr.icov += pcr.icov; acr.bcov += pcr.bcov; acr.mcov += pcr.mcov; } acr.files /= runResults.length; acr.gentime /= runResults.length; acr.exectime /= runResults.length; acr.icov /= runResults.length; acr.bcov /= runResults.length; acr.mcov /= runResults.length; aggClassResults.add(acr); } } private void aggregate(){ for(RunResult rr : runResults){ totalPrepTime += rr.totalPrepTime; avgGenTime += rr.avgGenTime; avgRunTime += rr.avgRunTime; avgBCov += rr.avgBCov; avgICov += rr.avgICov; avgMCov += rr.avgMCov; avgLCov += rr.avgLCov; avgMthdCov += rr.avgMthdCov; branches += rr.branches; methods += rr.methods; lines += rr.lines; mutations += rr.mutations; instructions += rr.instructions; coveredBranches += rr.coveredBranches; coveredMethods += rr.coveredMethods; coveredLines += rr.coveredLines; coveredMutations += rr.coveredMutations; coveredInstructions += rr.coveredInstructions; totalTestCases += rr.totalTestCases; genTime += rr.genTime; runTime += rr.runTime; cbmGenerated += rr.cbmGenerated; cbmKilled += rr.cbmKilled; ncmGenerated += rr.ncmGenerated; ncmKilled += rr.ncmKilled; mmGenerated += rr.mmGenerated; mmKilled += rr.mmKilled; imGenerated += rr.imGenerated; imKilled += rr.imKilled; inmGenerated += rr.inmGenerated; inmKilled += rr.inmKilled; rvmGenerated += rr.rvmGenerated; rvmKilled += rr.rvmKilled; vmcmGenerated += rr.vmcmGenerated; vmcmKilled += rr.vmcmKilled; } branches /= runResults.length; methods /= runResults.length; lines /= runResults.length; mutations /= runResults.length; instructions /= runResults.length; coveredBranches /= runResults.length; coveredMethods /= runResults.length; coveredLines /= runResults.length; coveredMutations /= runResults.length; coveredInstructions /= runResults.length; totalTestCases /= runResults.length; cbmGenerated /= runResults.length; cbmKilled /= runResults.length; ncmGenerated /= runResults.length; ncmKilled /= runResults.length; mmGenerated /= runResults.length; mmKilled /= runResults.length; imGenerated /= runResults.length; imKilled /= runResults.length; inmGenerated /= runResults.length; inmKilled /= runResults.length; rvmGenerated /= runResults.length; rvmKilled /= runResults.length; vmcmGenerated /= runResults.length; vmcmKilled /= runResults.length; avgBCov /= runResults.length; avgICov /= runResults.length; avgMCov /= runResults.length; avgLCov /= runResults.length; avgMthdCov /= runResults.length; totalPrepTime /= runResults.length; genTime /= runResults.length; runTime /= runResults.length; avgGenTime /= runResults.length; avgRunTime /= runResults.length; } public String toString(){ StringBuilder sb = new StringBuilder("\n"); sb.append(String.format("%s\n", new String(new char[160]).replace("\0", "-"))); sb.append(String.format("%-65s %-10s %-10s %-10s %-15s %-15s %-15s\n", "ClassName", "JUFiles", "t_gen", "t_exec", "% InstrCov", "% BranchCov", "% MutationCov")); sb.append(String.format("%s\n", new String(new char[160]).replace("\0", "-"))); for(AggregatedClassResult cr : aggClassResults){ sb.append(String.format("%-65s %-10.2f %-10.2f %-10.2f %-15.2f %-15.2f %-15.2f\n", cr.name, cr.files, cr.gentime / 1000.0 / 60.0, cr.exectime / 1000.0 / 60.0, cr.icov * 100.0, cr.bcov * 100.0, cr.mcov * 100.0)); } sb.append("\n\n"); String classes = sb.toString(); String aggregations = String.format("=== Results averaged over %d runs: ===\n" + "total number of CUTs: %d\n" + "total number of test cases (files): %f\n" + "average per class instruction coverage: %f %%\n" + "average per class line coverage: %f %%\n" + "average per class branch coverage: %f %%\n" + "average per class method coverage: %f %%\n" + "average per class mutation coverage: %f %%\n" + "overall covered instructions: %f / %d (%f %%)\n" + "overall covered lines: %f / %d (%f %%)\n" + "overall covered branches: %f / %d (%f %%)\n" + "overall covered methods: %f / %d (%f %%)\n" + "overall covered mutations: %f / %d (%f %%)\n" + "overall covered ConditionalBoundaryMutations: %f / %d (%f %%)\n" + "overall covered NegateConditionalMutations: %f / %d (%f %%)\n" + "overall covered MathMutations: %f / %d (%f %%)\n" + "overall covered IncrementMutations: %f / %d (%f %%)\n" + "overall covered InvertNegativeMutations: %f / %d (%f %%)\n" + "overall covered ReturnValueMutations: %f / %d (%f %%)\n" + "overall covered VoidMethodCallMutations: %f / %d (%f %%)\n" + "preparation time: %f seconds\n" + "average per class generation time: %f seconds\n" + "average per class execution time: %f seconds\n" + "total generation time: %f seconds\n" + "total execution time: %f seconds\n" + "overall score: >>> %f <<<\n", runResults.length, runResults[0].classResults.length, totalTestCases, avgICov * 100.0, avgLCov * 100.0, avgBCov * 100.0, avgMthdCov * 100.0, avgMCov * 100.0, coveredInstructions, instructions, ratio(coveredInstructions, instructions) * 100.0, coveredLines, lines, ratio(coveredLines, lines) * 100.0, coveredBranches, branches, ratio(coveredBranches, branches) * 100.0, coveredMethods, methods, ratio(coveredMethods, methods) * 100.0, coveredMutations, mutations, ratio(coveredMutations, mutations) * 100.0, cbmKilled, cbmGenerated, ratio(cbmKilled, cbmGenerated) * 100.0, ncmKilled, ncmGenerated, ratio(ncmKilled, ncmGenerated) * 100.0, mmKilled, mmGenerated, ratio(mmKilled, mmGenerated) * 100.0, imKilled, imGenerated, ratio(imKilled, imGenerated) * 100.0, inmKilled, inmGenerated, ratio(inmKilled, inmGenerated) * 100.0, rvmKilled, rvmGenerated, ratio(rvmKilled, rvmGenerated) * 100.0, vmcmKilled, vmcmGenerated, ratio(vmcmKilled, vmcmGenerated) * 100.0, (double) totalPrepTime / 1000.0, avgGenTime / 1000.0, avgRunTime / 1000.0, genTime / 1000.0, runTime / 1000.0, score()); return classes + aggregations; } } /* private static void average(File resultDir) throws IOException{ List results = new ArrayList(); List prepTimes = new ArrayList(); Map> datamap = new HashMap>(); for(File f : resultDir.listFiles()){ if(f.isDirectory() && f.getName().startsWith("run")){ String str = readFile(new File(f, "results.txt")); ClassData[] data = getData(str); for(ClassData cd : data){ if(!datamap.containsKey(cd.name)) datamap.put(cd.name, new ArrayList()); datamap.get(cd.name).add(cd); } int prepTime = getPrepTime(str); prepTimes.add(prepTime); results.add(getRunResult(data, prepTime)); } } if(results.isEmpty()){ System.out.println("No results found!"); return; } System.out.println(String.format("%-70s %-15s %-15s %-8s %-10s %-10s %-10s", "className", "avgGenTime(s)", "avgExecTime(s)", "avgTC", "avgLCov", "avgBCov", "avgMCov")); System.out.println("============================================================================================================================================================================"); for(String cl : datamap.keySet()){ List dataList = datamap.get(cl); double avgGenTime = 0.0; double avgExecTime = 0.0; double avgLCov = 0.0; double avgBCov = 0.0; double avgMCov = 0.0; double avgTC = 0.0; for(ClassData cd : dataList){ avgGenTime += Math.max(0, cd.genTime); avgExecTime += Math.max(0, cd.execTime); avgTC += Math.max(0, cd.numTestCases); avgLCov += Math.max(0, cd.lineCov); avgBCov += Math.max(0, cd.branchCov); avgMCov += Math.max(0, cd.mutationCov); } avgGenTime = avgGenTime / dataList.size() / 1000.0; avgExecTime = avgExecTime / dataList.size() / 1000.0; avgTC /= dataList.size(); avgLCov /= dataList.size(); avgBCov /= dataList.size(); avgMCov /= dataList.size(); System.out.println(String.format("%-70s : %-15.2f %-15.2f %-8.2f %-10.4f %-10.4f %-10.4f", cl, avgGenTime, avgExecTime, avgTC, avgLCov, avgBCov, avgMCov)); } System.out.println(); System.out.println(); double avgScore = 0.0; double avgPrepTime = 0.0; double avgGenTime = 0.0; double avgExecTime = 0.0; double avgLineCov = 0.0; double avgBranchCov = 0.0; double avgMutationCov = 0.0; double avgNumTestCases = 0.0; for(RunResult rr : results){ avgScore += rr.score; avgPrepTime += rr.totalPrepTime; avgGenTime += ((double)rr.totalGenTime) / rr.numClasses; avgExecTime += ((double)rr.totalExecTime / rr.numClasses); avgLineCov += rr.totalLineCov / rr.numClasses; avgBranchCov += rr.totalBranchCov / rr.numClasses; avgMutationCov += rr.totalMutationCov / rr.numClasses; avgNumTestCases += ((double)rr.totalNumTestCases) / rr.numClasses; } avgScore /= results.size(); avgPrepTime /= results.size(); avgGenTime /= results.size(); avgExecTime /= results.size(); avgLineCov /= results.size(); avgBranchCov /= results.size(); avgMutationCov /= results.size(); avgNumTestCases /= results.size(); double stdDevScore = 0.0; for(RunResult rr : results) stdDevScore += Math.pow(avgScore - rr.score, 2.0); stdDevScore = Math.sqrt(stdDevScore / (results.size() - 1)); System.out.println(String.format("%-70s : %d", "runs", results.size())); System.out.println(String.format("%-70s : %.4f seconds", "average preparation time", avgPrepTime / 1000.0)); System.out.println(String.format("%-70s : %.4f seconds", "average generation time per class", avgGenTime / 1000.0)); System.out.println(String.format("%-70s : %.4f seconds", "average execution time per class", avgExecTime / 1000.0)); System.out.println(String.format("%-70s : %.4f", "average line coverage", avgLineCov)); System.out.println(String.format("%-70s : %.4f", "average branch coverage", avgBranchCov)); System.out.println(String.format("%-70s : %.4f", "average mutation coverage", avgMutationCov)); System.out.println(String.format("%-70s : %.4f", "average number of test cases per class", avgNumTestCases)); System.out.println(); System.out.println("=============== FINAL SCORE ==============="); System.out.println(String.format("%.4f (sample standard deviation: %.4f)", avgScore, stdDevScore)); System.out.println("==========================================="); } */ private static double ratio(double dividend, double divisor){ return divisor == 0 ? 0 : (double) dividend / (double) divisor; } private static String readFile(File file) throws IOException { FileInputStream stream = new FileInputStream(file); try { FileChannel fc = stream.getChannel(); MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); return Charset.defaultCharset().decode(bb).toString(); } finally { stream.close(); } } private static Set findFiles(Set files, File path, String pattern){ for(File f : path.listFiles()){ if(f.isDirectory()){ findFiles(files, f, pattern); }else{ if(f.getName().matches(pattern)) files.add(f); } } return files; } private static Set findFiles(File path, String pattern){ return findFiles(new HashSet(), path, pattern); } public static void main(String[] argv){ try{ if(argv.length < 1){ System.out.println("usage: score |"); return; } File path = new File(argv[0]); if(path.isDirectory()){ // aggregate the results of multiple runs Set transcripts = findFiles(path, "transcript.txt"); String[] transcriptStrings = new String[transcripts.size()]; int i = 0; for(File transcript : transcripts){ transcriptStrings[i] = readFile(transcript); i++; } System.out.println(ExperimentResult.fromTranscripts(transcriptStrings)); }else{ // just show the results of a single run System.out.println(RunResult.fromTranscript(readFile(path).trim())); } }catch(IOException ioe){ System.out.println("Unable to process given file or path!"); return; } } }