public class ExecutionTracer extends Object
A problem here is that we can have threads left executing SUT instrumented classes after a HTTP call is finished, which can lead to an inconsistent state. So, we added thread synchronization. But issue of possible performance overhead, as this is done on every single instruction... :( Furthermore, this issue does not really seem to happen in Spring... as the sending of HTTP responses is not handled in the instrumented classes, but rather in the framework itself.
TODO sync only when necessary... however, currently the overhead seems minimal (but proper tests would be needed to confirm it)
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPLETED_LAST_EXECUTED_STATEMENT_DESCRIPTOR |
static String |
COMPLETED_LAST_EXECUTED_STATEMENT_NAME |
static String |
EXECUTED_LINE_DESCRIPTOR |
static String |
EXECUTED_LINE_METHOD_NAME |
static String |
EXECUTING_BRANCH_JUMP_METHOD_NAME |
static String |
EXECUTING_METHOD_DESCRIPTOR |
static String |
EXECUTING_METHOD_METHOD_NAME |
static String |
JUMP_DESC_1_VALUE |
static String |
JUMP_DESC_2_VALUES |
static String |
JUMP_DESC_NULL |
static String |
JUMP_DESC_OBJECTS |
static String |
SET_LAST_CALLER_CLASS_DESC |
static String |
SET_LAST_CALLER_CLASS_METHOD_NAME |
| Constructor and Description |
|---|
ExecutionTracer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addEmployedDefaultWMHost(ExternalServiceInfo hostInfo)
track what host uses the default WM
|
static void |
addExternalServiceHost(ExternalServiceInfo hostInfo)
To add the external service information to [AdditionalInfo]
|
static void |
addHeader(String header) |
static void |
addHostnameInfo(HostnameResolutionInfo hostnameResolutionInfo)
To add HostnameResolution information to [AdditionalInfo]
|
static void |
addMongoCollectionType(MongoCollectionSchema mongoCollectionSchema) |
static void |
addMongoInfo(MongoFindCommand info) |
static void |
addParsedDtoName(String name) |
static void |
addQueryParameter(String param) |
static void |
addSqlInfo(SqlInfo info) |
static void |
addStringSpecialization(String taintInputName,
StringSpecializationInfo info) |
static void |
completedLastExecutedStatement() |
static void |
executedLine(String className,
String methodName,
String descriptor,
int line)
Report on the fact that a given line has been executed.
|
static void |
executedNumericComparison(String idTemplate,
double lt,
double eq,
double gt) |
static void |
executedReplacedMethod(String idTemplate,
ReplacementType type,
Truthness t) |
static void |
executingBranchJump(int firstValue,
int secondValue,
int opcode,
String className,
int line,
int branchId) |
static void |
executingBranchJump(int value,
int opcode,
String className,
int line,
int branchId) |
static void |
executingBranchJump(Object obj,
int opcode,
String className,
int line,
int branchId) |
static void |
executingBranchJump(Object first,
Object second,
int opcode,
String className,
int line,
int branchId) |
static void |
executingMethod(String className,
int line,
int index,
boolean completed)
Report on whether method calls have been successfully completed.
|
static List<AdditionalInfo> |
exposeAdditionalInfoList() |
static String |
getActionName() |
static String |
getDefaultSinkholeAddress() |
static String |
getExternalMappingForHostname(String hostname) |
static String |
getExternalMappingForSignature(String signature)
Return the WireMock IP if there is a mapping for the hostname.
|
static Map<String,TargetInfo> |
getInternalReferenceToObjectiveCoverage() |
static String |
getLastCallerClass() |
static ClassLoader |
getLastCallerClassLoader() |
static String |
getLastExecutedStatement() |
static String |
getLocalAddress(String hostname) |
static Set<String> |
getNonCoveredObjectives(String prefix) |
static int |
getNumberOfNonCoveredObjectives(String prefix)
Note: only the objectives encountered so far can have
been recorded.
|
static int |
getNumberOfObjectives() |
static int |
getNumberOfObjectives(String prefix) |
static String |
getRemoteHostname(String localAddress)
Return the respective remote hostname for the given local IP address
|
static TaintType |
getTaintType(String input) |
static Double |
getValue(String id) |
static void |
handleExtraHeaderTaint(String left,
String right) |
static void |
handleExtraParamTaint(String left,
String right) |
static void |
handleTaintForStringEquals(String left,
String right,
boolean ignoreCase) |
static boolean |
hasActiveExternalMappingForSignature(String signature) |
static boolean |
hasLocalAddressForHost(String hostname)
Check whether there is a local IP address available for the given
remote hostname.
|
static boolean |
hasMappingForLocalAddress(String localAddress)
Checks for any replacement available to given local IP address.
|
static boolean |
hasMockServerForHostname(String hostname) |
static void |
increaseExpensiveOperationCount() |
static boolean |
isExecutingAction() |
static boolean |
isExecutingInitSql() |
static boolean |
isKillSwitch() |
static boolean |
isTaintInput(String input)
Check if the given input represented a tainted value from the test cases.
|
static boolean |
isTooManyExpensiveOperations() |
static void |
markLastExecutedStatement(String lastLine,
String lastMethod) |
static void |
markRawAccessOfHttpBodyPayload() |
static void |
reportSleeping() |
static void |
reset() |
static void |
setAction(Action action) |
static void |
setExecutingAction(boolean executingAction) |
static void |
setExecutingInitMongo(boolean executingInitMongo) |
static void |
setExecutingInitSql(boolean executingInitSql) |
static void |
setKillSwitch(boolean killSwitch) |
static void |
setLastCallerClass(String className) |
static boolean |
skipHostname(String hostname) |
static boolean |
skipHostnameAndPort(String hostname,
int port) |
public static final String SET_LAST_CALLER_CLASS_METHOD_NAME
public static final String SET_LAST_CALLER_CLASS_DESC
public static final String COMPLETED_LAST_EXECUTED_STATEMENT_NAME
public static final String COMPLETED_LAST_EXECUTED_STATEMENT_DESCRIPTOR
public static final String EXECUTED_LINE_METHOD_NAME
public static final String EXECUTED_LINE_DESCRIPTOR
public static final String EXECUTING_METHOD_METHOD_NAME
public static final String EXECUTING_METHOD_DESCRIPTOR
public static final String EXECUTING_BRANCH_JUMP_METHOD_NAME
public static final String JUMP_DESC_1_VALUE
public static final String JUMP_DESC_2_VALUES
public static final String JUMP_DESC_OBJECTS
public static final String JUMP_DESC_NULL
public static void reset()
public static String getActionName()
public static void setLastCallerClass(String className)
public static ClassLoader getLastCallerClassLoader()
public static String getLastCallerClass()
public static void reportSleeping()
public static boolean isKillSwitch()
public static void setKillSwitch(boolean killSwitch)
public static boolean isExecutingInitSql()
public static void setExecutingInitSql(boolean executingInitSql)
public static void setExecutingInitMongo(boolean executingInitMongo)
public static boolean isExecutingAction()
public static void setExecutingAction(boolean executingAction)
public static void setAction(Action action)
public static void increaseExpensiveOperationCount()
public static boolean isTooManyExpensiveOperations()
public static boolean isTaintInput(String input)
public static void handleTaintForStringEquals(String left, String right, boolean ignoreCase)
public static List<AdditionalInfo> exposeAdditionalInfoList()
public static void markRawAccessOfHttpBodyPayload()
public static void addParsedDtoName(String name)
public static void addQueryParameter(String param)
public static void addHeader(String header)
public static void addStringSpecialization(String taintInputName, StringSpecializationInfo info)
public static void addSqlInfo(SqlInfo info)
public static void addMongoInfo(MongoFindCommand info)
public static void addMongoCollectionType(MongoCollectionSchema mongoCollectionSchema)
public static void markLastExecutedStatement(String lastLine, String lastMethod)
public static String getLastExecutedStatement()
public static void completedLastExecutedStatement()
public static Map<String,TargetInfo> getInternalReferenceToObjectiveCoverage()
public static int getNumberOfObjectives()
public static int getNumberOfObjectives(String prefix)
public static int getNumberOfNonCoveredObjectives(String prefix)
prefix - used for string matching of which objectives types
to consider, eg only lines or only branches.
Use "" or null to pick up everythingpublic static void executedNumericComparison(String idTemplate, double lt, double eq, double gt)
public static void executedReplacedMethod(String idTemplate, ReplacementType type, Truthness t)
public static void executedLine(String className, String methodName, String descriptor, int line)
public static void executingMethod(String className, int line, int index, boolean completed)
className - line - index - as there can be many method calls on same line, need to differentiate themcompleted - whether the method call was successfully completed.public static void executingBranchJump(int value,
int opcode,
String className,
int line,
int branchId)
public static void executingBranchJump(int firstValue,
int secondValue,
int opcode,
String className,
int line,
int branchId)
public static void executingBranchJump(Object first, Object second, int opcode, String className, int line, int branchId)
public static void executingBranchJump(Object obj, int opcode, String className, int line, int branchId)
public static void addHostnameInfo(HostnameResolutionInfo hostnameResolutionInfo)
public static void addExternalServiceHost(ExternalServiceInfo hostInfo)
public static void addEmployedDefaultWMHost(ExternalServiceInfo hostInfo)
public static String getExternalMappingForSignature(String signature)
public static boolean hasActiveExternalMappingForSignature(String signature)
public static boolean hasMockServerForHostname(String hostname)
public static boolean hasLocalAddressForHost(String hostname)
public static boolean hasMappingForLocalAddress(String localAddress)
public static String getRemoteHostname(String localAddress)
public static String getDefaultSinkholeAddress()
public static boolean skipHostname(String hostname)
public static boolean skipHostnameAndPort(String hostname, int port)
Copyright © 2016–2024. All rights reserved.