use of org.evosuite.statistics.OutputVariable in project evosuite by EvoSuite.
the class CoverageAnalysisOfClassSystemTest method testOneClassOneCriterion.
@Test
public void testOneClassOneCriterion() {
EvoSuite evosuite = new EvoSuite();
String targetClass = Calculator.class.getCanonicalName();
String testClass = CalculatorTest.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
Properties.CRITERION = new Properties.Criterion[] { Properties.Criterion.BRANCH };
String[] command = new String[] { "-class", targetClass, "-Djunit=" + testClass, "-measureCoverage" };
SearchStatistics statistics = (SearchStatistics) evosuite.parseCommandLine(command);
Assert.assertNotNull(statistics);
Map<String, OutputVariable<?>> outputVariables = statistics.getOutputVariables();
assertEquals(0.80, (Double) outputVariables.get("BranchCoverage").getValue(), 0.0);
assertEquals(0.80, (Double) outputVariables.get("Coverage").getValue(), 0.0);
assertEquals(4, (Integer) outputVariables.get("Tests_Executed").getValue(), 0);
assertEquals(4, (Integer) outputVariables.get("Covered_Goals").getValue(), 0);
assertEquals(5, (Integer) outputVariables.get("Total_Goals").getValue(), 0);
assertEquals("10111", outputVariables.get("BranchCoverageBitString").getValue());
}
use of org.evosuite.statistics.OutputVariable in project evosuite by EvoSuite.
the class CoverageAnalysisSystemTest method testBranchCoverage.
@Test
public void testBranchCoverage() {
SearchStatistics statistics = this.aux(new Properties.Criterion[] { Properties.Criterion.BRANCH });
Map<String, OutputVariable<?>> variables = statistics.getOutputVariables();
assertEquals(9, (Integer) variables.get("Total_Goals").getValue(), 0.0);
assertEquals(9, (Integer) variables.get("Covered_Goals").getValue(), 0.0);
}
use of org.evosuite.statistics.OutputVariable in project evosuite by EvoSuite.
the class CoverageAnalysisSystemTest method testLineCoverage.
@Test
public void testLineCoverage() {
SearchStatistics statistics = this.aux(new Properties.Criterion[] { Properties.Criterion.LINE });
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.OutputVariable in project evosuite by EvoSuite.
the class CoverageAnalysisSystemTest method testCBranchCoverage.
@Test
public void testCBranchCoverage() {
SearchStatistics statistics = this.aux(new Properties.Criterion[] { Properties.Criterion.CBRANCH });
Map<String, OutputVariable<?>> variables = statistics.getOutputVariables();
assertEquals(9, (Integer) variables.get("Total_Goals").getValue(), 0.0);
assertEquals(9, (Integer) variables.get("Covered_Goals").getValue(), 0.0);
}
use of org.evosuite.statistics.OutputVariable 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);
}
Aggregations