Skip to content

Commit

Permalink
scripts aren't quite right
Browse files Browse the repository at this point in the history
  • Loading branch information
saphirasnow committed Feb 7, 2022
1 parent d50f9b2 commit e644014
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions scripts/getMutants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ getResults() {
mvn jqf:repro -Dclass=$1 -Dmethod=$2 -Dinput=target/$7-fuzz-results/tmpZest/exp_$6/corpus -Djqf.repro.dumpArgsDir=target/$7-fuzz-results/tmpZest/exp_$6/args_corpus/
mvn jqf:repro -Dclass=$1 -Dmethod=$2 -Dinput=target/$7-fuzz-results/tmpMu2/exp_$6/corpus -Djqf.repro.dumpArgsDir=target/$7-fuzz-results/tmpMu2/exp_$6/args_corpus/

mvn mu2:mutate -Dclass=$1 -Dmethod=$3 -Dincludes=$4 -DtargetIncludes=$5 -Dinput=target/$7-fuzz-results/tmpZest/exp_$6/corpus > $7-results/zest-results-$6.txt
mvn mu2:mutate -Dclass=$1 -Dmethod=$3 -Dincludes=$4 -DtargetIncludes=$5 -Dinput=target/$7-fuzz-results/tmpMu2/exp_$6/corpus > $7-results/mutate-results-$6.txt
mvn mu2:mutate -Dclass=$1 -Dmethod=$3 -Dincludes=$4 -DtargetIncludes=$5 -Dinput=target/$7-fuzz-results/tmpZest/exp_$6/corpus -DresultsDir=$7-results/zest-results-$6 #> $7-results/zest-results-$6.txt
mvn mu2:mutate -Dclass=$1 -Dmethod=$3 -Dincludes=$4 -DtargetIncludes=$5 -Dinput=target/$7-fuzz-results/tmpMu2/exp_$6/corpus -DresultsDir=$7-results/mutate-results-$6 #> $7-results/mutate-results-$6.txt

cat $7-results/zest-results-$6.txt | grep -a "Running Mutant\|FAILURE" > $7-filters/zest-filter-$6.txt
cat $7-results/mutate-results-$6.txt | grep -a "Running Mutant\|FAILURE" > $7-filters/mutate-filter-$6.txt
cat $7-results/zest-results-$6/dmrg-report.txt | grep "killed by" -B 1 > $7-filters/zest-filter-$6.txt
cat $7-results/mutate-results-$6/dmrg-report.txt | grep "killed by" -B 1 > $7-filters/mutate-filter-$6.txt

}

Expand Down
2 changes: 1 addition & 1 deletion scripts/venn.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_killed_mutants(file_name):
mutant_name = lines[i][lines[i].index("Mutant"):].strip()
i += 1
while i < len(lines) and "Running Mutant" not in lines[i]:
if "FAILURE" in lines[i]:
if "killed by " in lines[i]:
killed = True
i += 1
if killed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public DiffMutationReproGuidance(File inputFile, File traceDir, MutationClassLoa
MCLs = mcls;
ind = -1;

reportFile = new File(resultsDir, "dmrg-report.csv");

reportFile = new File(resultsDir, "dmrg-report.txt");
this.optLevel = MCLs.getCartographyClassLoader().getOptLevel();
}

Expand Down Expand Up @@ -112,18 +111,18 @@ public void run(TestClass testClass, FrameworkMethod method, Object[] args) thro
MutationRunInfo mri = new MutationRunInfo(MCLs, mutationInstance, testClass, argBytes, args, method);

// run with MCL
System.out.println("Running " + mutationInstance);
System.out.println("Running Mutant " + mutationInstance);
try (PrintWriter pw = new PrintWriter(new FileOutputStream(reportFile, true))) {
pw.printf("Running %s\n", mutationInstance.toString());
pw.printf("Running Mutant %s\n", mutationInstance.toString());
}

try {
super.run(new TestClass(mri.clazz), mri.method, mri.args);
} catch (DiffException e) {
deadMutants.add(mutationInstance.id);
System.out.println("killed by " + e);
System.out.println("killed by input " + ind + ": " + e);
try (PrintWriter pw = new PrintWriter(new FileOutputStream(reportFile, true))) {
pw.printf("killed by %s\n", e.toString());
pw.printf("killed by input %d: %s\n", ind, e.toString());
}
} catch(InstrumentationException e) {
throw new GuidanceException(e);
Expand Down

0 comments on commit e644014

Please sign in to comment.