public class BranchCoverageSuiteFitness extends TestSuiteFitnessFunction
| Modifier and Type | Field and Description |
|---|---|
double |
bestFitness |
protected Map<Integer,TestFitnessFunction> |
branchCoverageFalseMap |
protected Map<Integer,TestFitnessFunction> |
branchCoverageTrueMap |
protected Set<Integer> |
branchesId |
int |
maxCoveredBranches |
int |
maxCoveredMethods |
int |
numBranchlessMethods |
int |
totalBranches |
double |
totalCovered |
int |
totalGoals |
int |
totalMethods |
| Constructor and Description |
|---|
BranchCoverageSuiteFitness()
Constructor for BranchCoverageSuiteFitness.
|
BranchCoverageSuiteFitness(ClassLoader classLoader)
Constructor for BranchCoverageSuiteFitness.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
determineCoverageGoals()
Initialize the set of known coverage goals
|
double |
getFitness(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite)
Calculate and set fitness function #TODO the 'set fitness' part should be
done by some abstract super class of all FitnessFunctions
|
int |
getMaxValue() |
protected void |
handleBranchlessMethods(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite,
ExecutionResult result,
Map<String,Integer> callCount) |
protected void |
handleFalseDistances(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite,
ExecutionResult result,
Map<Integer,Double> falseDistance) |
protected void |
handlePredicateCount(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite,
ExecutionResult result,
Map<Integer,Integer> predicateCount) |
protected void |
handleTrueDistances(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite,
ExecutionResult result,
Map<Integer,Double> trueDistance) |
boolean |
updateCoveredGoals()
if the fitness function contains an archive, updates the archive and the fitness values of the population, and returns true.
|
isMaximizationFunction, runTest, runTestSuitegetBestStoredIndividual, normalize, updateIndividual, updateIndividualpublic int totalGoals
public int totalMethods
public int totalBranches
public final int numBranchlessMethods
public int maxCoveredBranches
public int maxCoveredMethods
public double bestFitness
protected final Map<Integer,TestFitnessFunction> branchCoverageTrueMap
protected final Map<Integer,TestFitnessFunction> branchCoverageFalseMap
public double totalCovered
public BranchCoverageSuiteFitness()
Constructor for BranchCoverageSuiteFitness.
public BranchCoverageSuiteFitness(ClassLoader classLoader)
Constructor for BranchCoverageSuiteFitness.
protected void determineCoverageGoals()
protected void handleBranchlessMethods(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite, ExecutionResult result, Map<String,Integer> callCount)
protected void handlePredicateCount(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite, ExecutionResult result, Map<Integer,Integer> predicateCount)
protected void handleTrueDistances(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite, ExecutionResult result, Map<Integer,Double> trueDistance)
protected void handleFalseDistances(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite, ExecutionResult result, Map<Integer,Double> falseDistance)
public boolean updateCoveredGoals()
FitnessFunctionupdateCoveredGoals in class FitnessFunction<AbstractTestSuiteChromosome<? extends ExecutableChromosome>>public double getFitness(AbstractTestSuiteChromosome<? extends ExecutableChromosome> suite)
getFitness in class FitnessFunction<AbstractTestSuiteChromosome<? extends ExecutableChromosome>>suite - a Chromosome object.public int getMaxValue()
Copyright © 2010–2017 EvoSuite. All rights reserved.