public class ExecutionTraceImpl extends Object implements ExecutionTrace, Cloneable
| Modifier and Type | Class and Description |
|---|---|
static class |
ExecutionTraceImpl.BranchEval
Deprecated.
|
| Constructor and Description |
|---|
ExecutionTraceImpl()
Constructor for ExecutionTraceImpl.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProxy()
addProxy
|
void |
branchPassed(int branch,
int bytecode_id,
double true_distance,
double false_distance)
Add branch to currently active method call
|
void |
classInitialized(String classNameWithDots)
Adds the class to the list of those classes that were initialized during
this test execution.
|
void |
clear()
Reset to 0
|
ExecutionTraceImpl |
clone()
Create a deep copy
|
void |
definitionPassed(Object object,
Object caller,
int defID)
Adds Definition-Use-Coverage trace information for the given definition.
|
static void |
disableContext() |
static void |
disableTraceCalls()
disableTraceCalls
|
static void |
enableContext() |
static void |
enableTraceCalls()
enableTraceCalls
|
static void |
enableTraceCoverage()
enableTraceCoverage
|
void |
enteredMethod(String className,
String methodName,
Object caller)
Add a new method call to stack
|
boolean |
equals(Object obj) |
void |
exitMethod(String classname,
String methodname)
Pop last method call from stack
|
void |
finishCalls()
Finish all method calls.
|
Set<Integer> |
getAllCoveredLines()
Retrieve the set of all line numbers covered
|
List<ExecutionTraceImpl.BranchEval> |
getBranchesTrace()
getBranchesTrace
|
Set<String> |
getClassesWithStaticReads()
Retrieve a list of those classes that were affected by a GETSTATIC.
|
Set<String> |
getClassesWithStaticWrites()
Retrieve a list of those classes that were affected by a PUTSTATIC.
|
Map<String,Map<String,Map<Integer,Integer>>> |
getCoverageData()
Retrieve detailed line coverage count
|
Set<String> |
getCoveredBranchlessMethods()
Retrieve the names of all covered branchless methods
|
Set<Integer> |
getCoveredDefinitions()
Retrieve set of definitions that were executed
|
Set<Integer> |
getCoveredFalseBranches()
Retrieve set of branches that evaluated to false
|
Set<Integer> |
getCoveredLines()
Retrieve the set of line numbers covered of
Properties.TARGET_CLASS class |
Set<Integer> |
getCoveredLines(String className)
Retrieve the set of line numbers covered
|
Set<String> |
getCoveredMethods()
Retrieve the names of all called methods
|
Set<Integer> |
getCoveredPredicates()
Retrieve set of branches that were executed
|
Set<Integer> |
getCoveredTrueBranches()
Retrieve set of branches that evaluated to true
|
Map<String,HashMap<Integer,HashMap<Integer,Integer>>> |
getDefinitionData()
Retrieve data definitions
|
Map<String,HashMap<Integer,HashMap<Integer,Object>>> |
getDefinitionDataObjects()
Retrieve data definitions
|
Map<Integer,Integer> |
getDefinitionExecutionCount()
Retrieve execution counts for definitions
|
Throwable |
getExplicitException()
Retrieve the exception thrown in this trace
|
double |
getFalseDistance(int branchId)
Retrieve minimum branch distance to false branch
|
Map<Integer,Double> |
getFalseDistances()
Retrieve map of all minimal false distances
|
Map<Integer,Map<CallContext,Double>> |
getFalseDistancesContext()
Retrieve map of all minimal false distances
|
Map<Integer,Double> |
getFalseDistancesSum()
getFalseDistancesSum
|
Set<Integer> |
getInfectedMutants()
Retrieve IDs of all executed mutants with an infection distance == 0.0
|
List<String> |
getInitializedClasses()
Returns the list (with no repetitions) following the order in which the
|
List<MethodCall> |
getMethodCalls()
Retrieve all traced method calls
|
Map<String,Map<CallContext,Integer>> |
getMethodContextCount()
Retrieve map of all context method counts
|
Map<String,Integer> |
getMethodExecutionCount()
Retrieve execution counts for methods
|
double |
getMutationDistance(int mutationId)
Retrieve the minimum infection distance for a mutant
|
Map<Integer,Double> |
getMutationDistances()
Retrieve all minimal infection distances
|
Set<Integer> |
getPassedDefIDs()
Retrieve the set of all definitions by id
|
Map<Integer,HashMap<Integer,Integer>> |
getPassedDefinitions(String variableName)
Retrieve the data definitions for a given variable
|
Set<Integer> |
getPassedUseIDs()
Retrieve the set of all uses by id
|
Map<String,HashMap<Integer,HashMap<Integer,Integer>>> |
getPassedUses()
getPassedUses
|
Map<Integer,HashMap<Integer,Integer>> |
getPassedUses(String variableName)
Retrieve the data uses for a given variable
|
Map<Integer,Map<CallContext,Integer>> |
getPredicateContextExecutionCount()
Retrieve number of predicate executions
|
Map<Integer,Integer> |
getPredicateExecutionCount()
Retrieve execution counts for branches
|
int |
getProxyCount()
Getter for the field
proxyCount. |
Map<String,Map<String,Map<Integer,Integer>>> |
getReturnData()
Retrieve return value data
|
void |
getStaticPassed(String classNameWithDots,
String fieldName)
Record a GETSTATIC statement
|
Set<Integer> |
getTouchedMutants()
Retrieve IDs of all executed mutants
|
ExecutionTrace |
getTraceForObject(int objectId)
Returns a copy of this trace where all MethodCall-information traced from
objects other then the one identified by the given objectID is removed
from the finished_calls-field
WARNING: this will not affect this.true_distances and other fields of
ExecutionTrace this only affects the finished_calls field (which should
suffice for BranchCoverageFitness-calculation)
|
ExecutionTrace |
getTraceInDUCounterRange(DefUse targetDU,
boolean wantToCoverTargetDU,
int duCounterStart,
int duCounterEnd)
Returns a copy of this trace where all MethodCall-information associated
with duCounters outside the range of the given duCounter-Start and -End
is removed from the finished_calls-traces
finished_calls without any point in the trace at which the given
duCounter range is hit are removed completely
Also traces for methods other then the one that holds the given targetDU
are removed as well as trace information that would pass the branch of
the given targetDU If wantToCoverTargetDU is false instead those
targetDUBranch information is removed that would pass the alternative
branch of targetDU
The latter is because this method only gets called when the given
targetDU was not active in the given duCounter-range if and only if
wantToCoverTargetDU is set, and since useFitness calculation is on branch
level and the branch of the targetDU can be passed before the targetDU is
passed this can lead to a flawed branchFitness.
|
double |
getTrueDistance(int branchId)
Retrieve minimum branch distance to true branch
|
Map<Integer,Double> |
getTrueDistances()
Retrieve map of all minimal true distances
|
Map<Integer,Map<CallContext,Double>> |
getTrueDistancesContext()
Retrieve map of all minimal true distances
|
Map<Integer,Double> |
getTrueDistancesSum()
getTrueDistancesSum
|
Map<String,HashMap<Integer,HashMap<Integer,Integer>>> |
getUseData()
Retrieve data uses
|
Map<String,HashMap<Integer,HashMap<Integer,Object>>> |
getUseDataObjects()
Retrieve data uses
|
boolean |
hasFalseDistance(int predicateId)
Determine if a branch has a false distance stored
|
int |
hashCode() |
boolean |
hasTrueDistance(int predicateId)
Determine if a branch has a true distance stored
|
static boolean |
isTraceCallsEnabled() |
ExecutionTrace |
lazyClone()
Create a lazy copy
|
void |
linePassed(String className,
String methodName,
int line)
Add line to currently active method call
|
void |
mutationPassed(int mutationId,
double distance)
Record a mutant execution
|
void |
putStaticPassed(String classNameWithDots,
String fieldName)
Record a PUTSTATIC statement
|
void |
removeProxy()
removeProxy
|
void |
returnValue(String className,
String methodName,
int value)
Record a return value
|
void |
setExplicitException(Throwable explicitException)
Set the exception thrown in this trace
|
String |
toDefUseTraceInformation()
Returns a String containing the information in passedDefs and passedUses
Used for Definition-Use-Coverage-debugging
|
String |
toDefUseTraceInformation(String targetVar)
Returns a String containing the information in passedDefs and passedUses
filtered for a specific variable
Used for Definition-Use-Coverage-debugging
|
String |
toDefUseTraceInformation(String var,
int objectId)
Returns a String containing the information in passedDefs and passedUses
for the given variable
Used for Definition-Use-Coverage-debugging
|
String |
toString() |
void |
usePassed(Object object,
Object caller,
int useID)
Adds Definition-Use-Coverage trace information for the given use.
|
boolean |
wasMutationTouched(int mutationId)
Determine is a mutant was executed
|
public static boolean traceCalls
traceCalls=falsepublic static boolean disableContext
public static boolean traceCoverage
traceCoverage=truepublic Map<Integer,Map<CallContext,Double>> coveredTrueContext
public Map<Integer,Map<CallContext,Double>> coveredFalseContext
public Map<Integer,Map<CallContext,Integer>> coveredPredicateContext
public Map<String,Map<CallContext,Integer>> coveredMethodContext
public List<MethodCall> finishedCalls
public Map<String,HashMap<Integer,HashMap<Integer,Object>>> passedDefinitionObject
public static Map<RuntimeVariable,Set<Integer>> bytecodeInstructionReached
public static Map<RuntimeVariable,Set<Integer>> bytecodeInstructionCoveredTrue
public static Map<RuntimeVariable,Set<Integer>> bytecodeInstructionCoveredFalse
public ExecutionTraceImpl()
Constructor for ExecutionTraceImpl.
public static void enableContext()
public static void disableContext()
public static void disableTraceCalls()
disableTraceCalls
public static void enableTraceCalls()
enableTraceCalls
public static boolean isTraceCallsEnabled()
public static void enableTraceCoverage()
enableTraceCoverage
public void addProxy()
addProxy
public void removeProxy()
removeProxy
public void branchPassed(int branch,
int bytecode_id,
double true_distance,
double false_distance)
branchPassed in interface ExecutionTracebranch - a int.bytecode_id - a int.true_distance - a double.false_distance - a double.public void clear()
clear in interface ExecutionTracepublic ExecutionTraceImpl clone()
public void definitionPassed(Object object, Object caller, int defID)
definitionPassed in interface ExecutionTracecaller - a Object object.defID - a int.public void enteredMethod(String className, String methodName, Object caller)
enteredMethod in interface ExecutionTraceclassName - a String object.methodName - a String object.caller - a Object object.public void exitMethod(String classname, String methodname)
exitMethod in interface ExecutionTraceclassname - a String object.methodname - a String object.public void finishCalls()
finishCalls in interface ExecutionTracepublic List<ExecutionTraceImpl.BranchEval> getBranchesTrace()
getBranchesTrace
getBranchesTrace in interface ExecutionTraceList object.public Map<String,Map<String,Map<Integer,Integer>>> getCoverageData()
getCoverageData in interface ExecutionTraceMap object.public Set<Integer> getCoveredFalseBranches()
getCoveredFalseBranches in interface ExecutionTraceSet object.public Set<Integer> getCoveredLines(String className)
getCoveredLines in interface ExecutionTraceclassName - a String object.Set object.public Set<Integer> getCoveredLines()
ExecutionTraceProperties.TARGET_CLASS classgetCoveredLines in interface ExecutionTraceSet object.public Set<Integer> getAllCoveredLines()
ExecutionTracegetAllCoveredLines in interface ExecutionTracepublic Set<String> getCoveredMethods()
getCoveredMethods in interface ExecutionTraceSet object.public Set<String> getCoveredBranchlessMethods()
ExecutionTracegetCoveredBranchlessMethods in interface ExecutionTraceSet object.public Set<Integer> getCoveredPredicates()
getCoveredPredicates in interface ExecutionTraceSet object.public Set<Integer> getCoveredTrueBranches()
getCoveredTrueBranches in interface ExecutionTraceSet object.public Set<Integer> getCoveredDefinitions()
ExecutionTracegetCoveredDefinitions in interface ExecutionTraceSet object.public Map<Integer,Integer> getDefinitionExecutionCount()
ExecutionTracegetDefinitionExecutionCount in interface ExecutionTraceMap object.public Map<String,HashMap<Integer,HashMap<Integer,Integer>>> getDefinitionData()
getDefinitionData in interface ExecutionTraceMap object.public Map<String,HashMap<Integer,HashMap<Integer,Object>>> getDefinitionDataObjects()
ExecutionTracegetDefinitionDataObjects in interface ExecutionTraceMap object.public Throwable getExplicitException()
getExplicitException in interface ExecutionTraceThrowable object.public double getFalseDistance(int branchId)
getFalseDistance in interface ExecutionTracebranchId - a int.public Map<Integer,Double> getFalseDistances()
getFalseDistances in interface ExecutionTraceMap object.public List<MethodCall> getMethodCalls()
getMethodCalls in interface ExecutionTraceList object.public Map<String,Integer> getMethodExecutionCount()
getMethodExecutionCount in interface ExecutionTraceMap object.public double getMutationDistance(int mutationId)
getMutationDistance in interface ExecutionTracemutationId - a int.public Map<Integer,Double> getMutationDistances()
getMutationDistances in interface ExecutionTraceMap object.public Map<Integer,HashMap<Integer,Integer>> getPassedDefinitions(String variableName)
getPassedDefinitions in interface ExecutionTracevariableName - a String object.Map object.public Map<Integer,HashMap<Integer,Integer>> getPassedUses(String variableName)
getPassedUses in interface ExecutionTracevariableName - a String object.Map object.public Map<Integer,Integer> getPredicateExecutionCount()
getPredicateExecutionCount in interface ExecutionTraceMap object.public int getProxyCount()
Getter for the field proxyCount.
public Map<String,Map<String,Map<Integer,Integer>>> getReturnData()
getReturnData in interface ExecutionTraceMap object.public Set<Integer> getTouchedMutants()
getTouchedMutants in interface ExecutionTraceSet object.public Set<Integer> getInfectedMutants()
ExecutionTracegetInfectedMutants in interface ExecutionTraceSet object.public ExecutionTrace getTraceForObject(int objectId)
getTraceForObject in interface ExecutionTraceobjectId - a int.ExecutionTrace object.public ExecutionTrace getTraceInDUCounterRange(DefUse targetDU, boolean wantToCoverTargetDU, int duCounterStart, int duCounterEnd)
getTraceInDUCounterRange in interface ExecutionTracetargetDU - a DefUse object.wantToCoverTargetDU - a boolean.duCounterStart - a int.duCounterEnd - a int.ExecutionTrace object.public double getTrueDistance(int branchId)
getTrueDistance in interface ExecutionTracebranchId - a int.public Map<Integer,Double> getTrueDistances()
getTrueDistances in interface ExecutionTraceMap object.public Map<String,HashMap<Integer,HashMap<Integer,Integer>>> getUseData()
getUseData in interface ExecutionTraceMap object.public Map<String,HashMap<Integer,HashMap<Integer,Object>>> getUseDataObjects()
ExecutionTracegetUseDataObjects in interface ExecutionTraceMap object.public boolean hasFalseDistance(int predicateId)
hasFalseDistance in interface ExecutionTracepredicateId - a int.public boolean hasTrueDistance(int predicateId)
hasTrueDistance in interface ExecutionTracepredicateId - a int.public ExecutionTrace lazyClone()
lazyClone in interface ExecutionTraceExecutionTrace object.public void linePassed(String className, String methodName, int line)
linePassed in interface ExecutionTraceclassName - a String object.methodName - a String object.line - a int.public void mutationPassed(int mutationId,
double distance)
mutationPassed in interface ExecutionTracemutationId - a int.distance - a double.public void returnValue(String className, String methodName, int value)
returnValue in interface ExecutionTraceclassName - a String object.methodName - a String object.value - a int.public void setExplicitException(Throwable explicitException)
setExplicitException in interface ExecutionTraceexplicitException - a Throwable object.public String toDefUseTraceInformation()
toDefUseTraceInformation in interface ExecutionTraceString object.public String toDefUseTraceInformation(String targetVar)
toDefUseTraceInformation in interface ExecutionTracetargetVar - a String object.String object.public String toDefUseTraceInformation(String var, int objectId)
toDefUseTraceInformation in interface ExecutionTracevar - a String object.objectId - a int.String object.public void usePassed(Object object, Object caller, int useID)
usePassed in interface ExecutionTracecaller - a Object object.useID - a int.public boolean wasMutationTouched(int mutationId)
wasMutationTouched in interface ExecutionTracemutationId - a int.public Map<Integer,Double> getFalseDistancesSum()
getFalseDistancesSum
getFalseDistancesSum in interface ExecutionTraceMap object.public Map<Integer,Double> getTrueDistancesSum()
getTrueDistancesSum
getTrueDistancesSum in interface ExecutionTraceMap object.public Map<String,HashMap<Integer,HashMap<Integer,Integer>>> getPassedUses()
getPassedUses
getPassedUses in interface ExecutionTraceMap object.public Set<Integer> getPassedDefIDs()
ExecutionTracegetPassedDefIDs in interface ExecutionTracepublic Set<Integer> getPassedUseIDs()
ExecutionTracegetPassedUseIDs in interface ExecutionTracepublic Map<Integer,Map<CallContext,Double>> getTrueDistancesContext()
ExecutionTracegetTrueDistancesContext in interface ExecutionTraceMap object.public Map<Integer,Map<CallContext,Double>> getFalseDistancesContext()
ExecutionTracegetFalseDistancesContext in interface ExecutionTraceMap object.public Map<Integer,Map<CallContext,Integer>> getPredicateContextExecutionCount()
ExecutionTracegetPredicateContextExecutionCount in interface ExecutionTraceMap object.public Map<String,Map<CallContext,Integer>> getMethodContextCount()
ExecutionTracegetMethodContextCount in interface ExecutionTraceMap object.public void putStaticPassed(String classNameWithDots, String fieldName)
ExecutionTraceputStaticPassed in interface ExecutionTracepublic void getStaticPassed(String classNameWithDots, String fieldName)
ExecutionTracegetStaticPassed in interface ExecutionTracepublic Set<String> getClassesWithStaticWrites()
ExecutionTracegetClassesWithStaticWrites in interface ExecutionTracepublic void classInitialized(String classNameWithDots)
classInitialized in interface ExecutionTracepublic Set<String> getClassesWithStaticReads()
ExecutionTracegetClassesWithStaticReads in interface ExecutionTracepublic List<String> getInitializedClasses()
ExecutionTracegetInitializedClasses in interface ExecutionTraceCopyright © 2010–2017 EvoSuite. All rights reserved.