public class TestChromosome extends ExecutableChromosome
| Modifier and Type | Field and Description |
|---|---|
protected MutationHistory<TestMutationHistoryEntry> |
mutationHistory
To keep track of what has changed since last fitness evaluation
|
protected TestCase |
test
The test case encoded in this chromosome
|
lastExecutionResult, lastMutationResultage, distance, rank, toBeUpdated| Constructor and Description |
|---|
TestChromosome() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addSecondaryObjective(SecondaryObjective<?> objective)
Add an additional secondary objective to the end of the list of
objectives
|
void |
clearMutationHistory() |
Chromosome |
clone()
clone
|
<T extends Chromosome> |
compareSecondaryObjective(T o)
Secondary Objectives are specific to chromosome types
|
int |
compareTo(Chromosome o)
Determine relative ordering of this chromosome to another chromosome.
|
void |
copyCachedResults(ExecutableChromosome other)
copyCachedResults
|
void |
crossOver(Chromosome other,
int position1,
int position2)
Single point cross over
|
protected boolean |
deleteStatement(TestFactory testFactory,
int num) |
boolean |
equals(Object obj)
Two chromosomes are equal if their tests are equal
|
ExecutionResult |
executeForFitnessFunction(TestSuiteFitnessFunction testSuiteFitnessFunction)
executeForFitnessFunction
|
MutationHistory<TestMutationHistoryEntry> |
getMutationHistory() |
static List<SecondaryObjective<?>> |
getSecondaryObjectives()
Getter for the field
secondaryObjectives. |
TestCase |
getTestCase()
getTestCase
|
boolean |
hasException()
hasException
|
int |
hashCode() |
boolean |
hasRelevantMutations() |
boolean |
localSearch(LocalSearchObjective<? extends Chromosome> objective)
Apply the local search
|
void |
mutate()
Apply mutation
|
boolean |
mutationInsert()
With exponentially decreasing probability, insert statements at random
position
|
static void |
removeSecondaryObjective(SecondaryObjective<?> objective)
Remove secondary objective from list, if it is there
|
static void |
reverseSecondaryObjective() |
void |
setChanged(boolean changed)
Set changed status to @param changed
|
void |
setLastExecutionResult(ExecutionResult lastExecutionResult)
Setter for the field
lastExecutionResult. |
void |
setTestCase(TestCase testCase)
setTestCase
|
static void |
ShuffleSecondaryObjective() |
int |
size()
Return length of individual
|
String |
toString() |
clearCachedMutationResults, clearCachedResults, getLastExecutionResult, getLastExecutionResult, setLastExecutionResultaddFitness, addFitness, addFitness, addFitness, crossOver, getAge, getCoverage, getCoverage, getCoverageInstanceOf, getCoverageValues, getDistance, getFitness, getFitness, getFitnessInstanceOf, getFitnessValues, getNumOfCoveredGoals, getNumOfCoveredGoals, getNumOfNotCoveredGoals, getNumOfNotCoveredGoals, getNumsNotCoveredGoals, getNumsOfCoveredGoals, getPreviousFitnessValues, getRank, hasExecutedFitness, hasFitnessChanged, hasLocalSearchBeenApplied, isChanged, isToBeUpdated, isToBeUpdated, setCoverage, setCoverageValues, setDistance, setFitness, setFitnessValues, setLocalSearchApplied, setNumOfCoveredGoals, setNumOfNotCoveredGoals, setNumsOfCoveredGoals, setNumsOfNotCoveredGoals, setPreviousFitnessValues, setRank, updateAgeprotected TestCase test
protected MutationHistory<TestMutationHistoryEntry> mutationHistory
public void setTestCase(TestCase testCase)
setTestCase
testCase - a TestCase object.public void setLastExecutionResult(ExecutionResult lastExecutionResult)
Setter for the field lastExecutionResult.
setLastExecutionResult in class ExecutableChromosomelastExecutionResult - a ExecutionResult object.public void setChanged(boolean changed)
setChanged in class Chromosomechanged - a boolean.public Chromosome clone()
clone
Create a deep copy of the chromosome Create a deep copy of the chromosomeclone in interface PublicCloneable<Chromosome>clone in class Chromosomepublic void copyCachedResults(ExecutableChromosome other)
copyCachedResults
copyCachedResults in class ExecutableChromosomeother - a ExecutableChromosome object.public void crossOver(Chromosome other, int position1, int position2) throws ConstructionFailedException
crossOver in class Chromosomeother - a Chromosome object.position1 - a int.position2 - a int.ConstructionFailedException - if any.public boolean equals(Object obj)
equals in class Chromosomepublic int hashCode()
hashCode in class Chromosomepublic MutationHistory<TestMutationHistoryEntry> getMutationHistory()
public void clearMutationHistory()
public boolean hasRelevantMutations()
public boolean localSearch(LocalSearchObjective<? extends Chromosome> objective)
localSearch in class Chromosomeobjective - a LocalSearchObjective
object.public void mutate()
mutate in class Chromosomeprotected boolean deleteStatement(TestFactory testFactory, int num)
public boolean mutationInsert()
public int size()
size in class Chromosomepublic int compareTo(Chromosome o)
compareTo in interface Comparable<Chromosome>compareTo in class Chromosomepublic boolean hasException()
hasException
public ExecutionResult executeForFitnessFunction(TestSuiteFitnessFunction testSuiteFitnessFunction)
executeForFitnessFunction
executeForFitnessFunction in class ExecutableChromosometestSuiteFitnessFunction - a TestSuiteFitnessFunction object.ExecutionResult object.public <T extends Chromosome> int compareSecondaryObjective(T o)
ChromosomecompareSecondaryObjective in class Chromosomeo - a Chromosome object.public static void addSecondaryObjective(SecondaryObjective<?> objective)
objective - a SecondaryObjective object.public static void ShuffleSecondaryObjective()
public static void reverseSecondaryObjective()
public static void removeSecondaryObjective(SecondaryObjective<?> objective)
objective - a SecondaryObjective object.public static List<SecondaryObjective<?>> getSecondaryObjectives()
Getter for the field secondaryObjectives.
List object.Copyright © 2010–2017 EvoSuite. All rights reserved.