use of org.evosuite.statistics.SearchStatistics in project evosuite by EvoSuite.
the class CoverageAnalysisSystemTest method testRhoCoverage.
@Test
public void testRhoCoverage() {
SearchStatistics statistics = this.aux(new Properties.Criterion[] { Properties.Criterion.RHO });
Map<String, OutputVariable<?>> variables = statistics.getOutputVariables();
assertEquals(11, (Integer) variables.get("Total_Goals").getValue(), 0.0);
assertEquals(11, (Integer) variables.get("Covered_Goals").getValue(), 0.0);
}
use of org.evosuite.statistics.SearchStatistics in project evosuite by EvoSuite.
the class CoverageAnalysisSystemTest method aux.
private SearchStatistics aux(Criterion[] criterion) {
EvoSuite evosuite = new EvoSuite();
String targetClass = BMICalculator.class.getCanonicalName();
String testClass = TestBMICalculator.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
Properties.CRITERION = criterion;
String[] command = new String[] { "-class", targetClass, "-Djunit=" + testClass, "-measureCoverage" };
SearchStatistics statistics = (SearchStatistics) evosuite.parseCommandLine(command);
Assert.assertNotNull(statistics);
return statistics;
}
use of org.evosuite.statistics.SearchStatistics in project evosuite by EvoSuite.
the class CoverageAnalysisOfEvoSuiteTestSuiteSystemTest method testOneFitnessFunction.
@Test
public void testOneFitnessFunction() {
EvoSuite evosuite = new EvoSuite();
String targetClass = Euclidean.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
Properties.CRITERION = new Criterion[] { Criterion.BRANCH };
String[] command = new String[] { "-class", targetClass, "-Djunit=" + targetClass + Properties.JUNIT_SUFFIX, "-measureCoverage" };
SearchStatistics statistics = (SearchStatistics) evosuite.parseCommandLine(command);
Assert.assertNotNull(statistics);
Map<String, OutputVariable<?>> data = statistics.getOutputVariables();
assertEquals(5, (Integer) data.get("Total_Goals").getValue(), 0.0);
assertEquals(5, (Integer) data.get("Covered_Goals").getValue(), 0.0);
}
Aggregations