public class DefUseCoverageTestFitness extends TestFitnessFunction
| Modifier and Type | Class and Description |
|---|---|
static class |
DefUseCoverageTestFitness.DefUsePairType |
| Modifier and Type | Field and Description |
|---|---|
static long |
singleFitnessTime
Constant
singleFitnessTime=0l |
logger| Constructor and Description |
|---|
DefUseCoverageTestFitness(Definition def,
Use use,
DefUseCoverageTestFitness.DefUsePairType type)
Creates a Definition-Use-Coverage goal for the given Definition and Use
|
DefUseCoverageTestFitness(Use use)
Used for Parameter-Uses
Creates a goal that tries to cover the given Use
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(TestFitnessFunction other)
Used to preorder goals by difficulty
|
boolean |
equals(Object obj) |
int |
getCoveringObjectId()
Getter for the field
coveringObjectId. |
ExecutionTrace |
getCoveringTrace()
Getter for the field
coveringTrace. |
double |
getFitness(ExecutionResult result)
Used by DefUseCoverageSuiteFitness
Simply call getFitness(TestChromosome,ExecutionResult) with a dummy
TestChromosome The chromosome is used only for updateIndividual()
anyways.
|
double |
getFitness(TestChromosome individual,
ExecutionResult result)
getFitness
|
Definition |
getGoalDefinition()
Getter for the field
goalDefinition. |
TestFitnessFunction |
getGoalDefinitionFitness()
Getter for the field
goalDefinitionFitness. |
Use |
getGoalUse()
Getter for the field
goalUse. |
TestFitnessFunction |
getGoalUseFitness()
Getter for the field
goalUseFitness. |
String |
getGoalVariable()
Getter for the field
goalVariable. |
Set<BytecodeInstruction> |
getInstructionsAfterGoalDefinition()
Returns a set containing all CFGVertices in the goal definition method
that come after the definition.
|
Set<BytecodeInstruction> |
getInstructionsBeforeGoalUse()
Returns a set containing all CFGVertices in the goal use method that come
before the goal use.
|
Set<BytecodeInstruction> |
getInstructionsInBetweenDU()
Return a set containing all CFGVertices that occur in the complete CFG
after the goalDefinition and before the goalUse.
|
Set<BytecodeInstruction> |
getPotentialOverwritingDefinitions()
Returns the definitions to the goalVaraible coming after the
goalDefinition and before the goalUse in their respective methods
|
String |
getTargetClass() |
String |
getTargetMethod() |
DefUseCoverageTestFitness.DefUsePairType |
getType()
Getter for the field
type. |
int |
hashCode() |
boolean |
isAlias() |
boolean |
isCovered() |
boolean |
isInterMethodPair()
isInterMethodPair
|
boolean |
isIntraClassPair()
isIntraClassPair
|
boolean |
isParameterGoal()
isParameterGoal
|
void |
setCovered(boolean covered) |
void |
setCovered(TestChromosome individual,
ExecutionTrace trace,
Integer objectId)
setCovered
|
String |
toString() |
compareClassName, getFitness, isCovered, isCovered, isCovered, isCovered, isCovered, isCoveredBy, isCoveredByResults, isMaximizationFunction, runTestgetBestStoredIndividual, normalize, updateCoveredGoals, updateIndividual, updateIndividualpublic DefUseCoverageTestFitness(Definition def, Use use, DefUseCoverageTestFitness.DefUsePairType type)
def - a Definition object.use - a Use object.type - a
DefUseCoverageTestFitness.DefUsePairType
object.public double getFitness(TestChromosome individual, ExecutionResult result)
getFitness
Calculates the DefUseCoverage test fitness for this goal Look at DefUseCoverageCalculations.calculateDUFitness() for more informationgetFitness in class TestFitnessFunctionindividual - a TestChromosome object.result - a ExecutionResult object.public double getFitness(ExecutionResult result)
result - a ExecutionResult object.public boolean isAlias()
public Set<BytecodeInstruction> getPotentialOverwritingDefinitions()
Set object.public Set<BytecodeInstruction> getInstructionsInBetweenDU()
Set object.public Set<BytecodeInstruction> getInstructionsAfterGoalDefinition()
Set object.public Set<BytecodeInstruction> getInstructionsBeforeGoalUse()
Set object.public void setCovered(TestChromosome individual, ExecutionTrace trace, Integer objectId)
setCovered
individual - a Chromosome object.trace - a ExecutionTrace object.objectId - a Integer object.public ExecutionTrace getCoveringTrace()
Getter for the field coveringTrace.
ExecutionTrace object.public String getGoalVariable()
Getter for the field goalVariable.
String object.public int getCoveringObjectId()
Getter for the field coveringObjectId.
public Definition getGoalDefinition()
Getter for the field goalDefinition.
Definition object.public TestFitnessFunction getGoalUseFitness()
Getter for the field goalUseFitness.
TestFitnessFunction object.public TestFitnessFunction getGoalDefinitionFitness()
Getter for the field goalDefinitionFitness.
TestFitnessFunction object.public boolean isInterMethodPair()
isInterMethodPair
public boolean isIntraClassPair()
isIntraClassPair
public DefUseCoverageTestFitness.DefUsePairType getType()
Getter for the field type.
DefUseCoverageTestFitness.DefUsePairType
object.public boolean isParameterGoal()
isParameterGoal
public int hashCode()
hashCode in class TestFitnessFunctionpublic boolean equals(Object obj)
equals in class TestFitnessFunctionpublic int compareTo(TestFitnessFunction other)
TestFitnessFunctioncompareTo in interface Comparable<TestFitnessFunction>compareTo in class TestFitnessFunctionpublic boolean isCovered()
public void setCovered(boolean covered)
covered - the covered to setpublic String getTargetClass()
getTargetClass in class TestFitnessFunctionpublic String getTargetMethod()
getTargetMethod in class TestFitnessFunctionCopyright © 2010–2017 EvoSuite. All rights reserved.