public class BranchCoverageGoal extends Object implements Serializable, Comparable<BranchCoverageGoal>
| Constructor and Description |
|---|
BranchCoverageGoal(Branch branch,
boolean value,
String className,
String methodName)
Can be used to create an arbitrary
BranchCoverageGoal trying to cover the
given Branch |
BranchCoverageGoal(Branch branch,
boolean value,
String className,
String methodName,
int lineNumber)
Constructor accepting line number as parameter.
|
BranchCoverageGoal(ControlDependency cd,
String className,
String methodName)
Constructor for BranchCoverageGoal.
|
BranchCoverageGoal(String className,
String methodName)
Methods that have no branches don't need a cfg, so we just set the cfg to
null
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(BranchCoverageGoal o) |
boolean |
equals(Object obj) |
Branch |
getBranch() |
String |
getClassName() |
ControlFlowDistance |
getDistance(ExecutionResult result)
getDistance
|
int |
getId() |
int |
getLineNumber() |
String |
getMethodName() |
boolean |
getValue() |
int |
hashCode() |
int |
hashCodeWithoutValue() |
boolean |
isConnectedTo(BranchCoverageGoal goal)
Determines whether this goals is connected to the given goal
This is the case when this goals target branch is control dependent on
the target branch of the given goal or visa versa
This is used in the ChromosomeRecycler to determine if tests produced to
cover one goal should be used initially when trying to cover the other
goal
|
String |
toString()
Readable representation
|
public BranchCoverageGoal(Branch branch, boolean value, String className, String methodName)
BranchCoverageGoal trying to cover the
given Branch
If the given branch is null, this goal will try to cover the root branch
of the method identified by the given name - meaning it will just try to
call the method at hand
Otherwise this goal will try to reach the given branch and if value is true, make the branchInstruction jump and visa versa
public BranchCoverageGoal(Branch branch, boolean value, String className, String methodName, int lineNumber)
public BranchCoverageGoal(ControlDependency cd, String className, String methodName)
Constructor for BranchCoverageGoal.
cd - a ControlDependency object.className - a String object.methodName - a String object.public int getId()
public Branch getBranch()
public boolean getValue()
public String getClassName()
public String getMethodName()
public int getLineNumber()
public boolean isConnectedTo(BranchCoverageGoal goal)
goal - a BranchCoverageGoal
object.public ControlFlowDistance getDistance(ExecutionResult result)
getDistance
result - a ExecutionResult object.ControlFlowDistance object.public int hashCodeWithoutValue()
public int compareTo(BranchCoverageGoal o)
compareTo in interface Comparable<BranchCoverageGoal>Copyright © 2010–2017 EvoSuite. All rights reserved.