public class ExceptionCoverageTestFitness extends TestFitnessFunction
| Modifier and Type | Class and Description |
|---|---|
static class |
ExceptionCoverageTestFitness.ExceptionType |
| Modifier and Type | Field and Description |
|---|---|
protected String |
className |
protected Class<?> |
exceptionClass
The class representing the thrown exception, eg NPE an IAE
|
protected String |
methodIdentifier
name+descriptor
|
protected ExceptionCoverageTestFitness.ExceptionType |
type |
logger| Constructor and Description |
|---|
ExceptionCoverageTestFitness(String className,
String methodIdentifier,
Class<?> exceptionClass,
ExceptionCoverageTestFitness.ExceptionType type)
Constructor - fitness is specific to a method
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(TestFitnessFunction other)
Used to preorder goals by difficulty
|
boolean |
equals(Object obj) |
Class<?> |
getExceptionClass() |
double |
getFitness(TestChromosome individual,
ExecutionResult result)
getFitness
|
String |
getKey() |
String |
getMethod()
getMethod
|
String |
getTargetClass() |
String |
getTargetMethod() |
int |
hashCode() |
String |
toString() |
compareClassName, getFitness, isCovered, isCovered, isCovered, isCovered, isCovered, isCoveredBy, isCoveredByResults, isMaximizationFunction, runTestgetBestStoredIndividual, normalize, updateCoveredGoals, updateIndividual, updateIndividualprotected final String className
protected final String methodIdentifier
protected final Class<?> exceptionClass
protected final ExceptionCoverageTestFitness.ExceptionType type
public ExceptionCoverageTestFitness(String className, String methodIdentifier, Class<?> exceptionClass, ExceptionCoverageTestFitness.ExceptionType type) throws IllegalArgumentException
methodIdentifier - the method nameexceptionClass - the exception classIllegalArgumentExceptionpublic String getKey()
public Class<?> getExceptionClass()
public double getFitness(TestChromosome individual, ExecutionResult result)
getFitness
Calculate fitnessgetFitness in class TestFitnessFunctionindividual - a ExecutableChromosome object.result - a ExecutionResult object.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 String getTargetClass()
getTargetClass in class TestFitnessFunctionpublic String getTargetMethod()
getTargetMethod in class TestFitnessFunctionCopyright © 2010–2017 EvoSuite. All rights reserved.