public class ReplaceVariable extends Object implements MutationOperator
ReplaceVariable class.
| Constructor and Description |
|---|
ReplaceVariable() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPrimitiveDistanceCheck(org.objectweb.asm.tree.InsnList distance,
org.objectweb.asm.Type type,
org.objectweb.asm.tree.InsnList mutant)
addPrimitiveDistanceCheck
|
static void |
addReferenceDistanceCheck(org.objectweb.asm.tree.InsnList distance,
org.objectweb.asm.Type type,
org.objectweb.asm.tree.InsnList mutant)
addReferenceDistanceCheck
|
List<Mutation> |
apply(org.objectweb.asm.tree.MethodNode mn,
String className,
String methodName,
BytecodeInstruction instruction,
org.objectweb.asm.tree.analysis.Frame frame)
Insert the mutation into the bytecode
|
static boolean |
canUse(Field f)
This replicates TestUsageChecker.canUse but we need to avoid that
we try to access Properties.getTargetClassAndDontInitialise
|
static org.objectweb.asm.tree.InsnList |
cast(org.objectweb.asm.Type from,
org.objectweb.asm.Type to)
Generates the instructions to cast a numerical value from one type to
another.
|
static org.objectweb.asm.tree.InsnList |
copy(org.objectweb.asm.tree.InsnList orig)
copy
|
static double |
getDistance(double val1,
double val2)
getDistance
|
static double |
getDistance(Object obj1,
Object obj2)
getDistance
|
org.objectweb.asm.tree.InsnList |
getInfectionDistance(org.objectweb.asm.Type type,
org.objectweb.asm.tree.AbstractInsnNode original,
org.objectweb.asm.tree.InsnList mutant)
getInfectionDistance
|
boolean |
isApplicable(BytecodeInstruction instruction)
Check if the mutation operator is applicable to the instruction
|
public static final String NAME
public List<Mutation> apply(org.objectweb.asm.tree.MethodNode mn, String className, String methodName, BytecodeInstruction instruction, org.objectweb.asm.tree.analysis.Frame frame)
apply in interface MutationOperatormn - a MethodNode object.className - a String object.methodName - a String object.instruction - a BytecodeInstruction object.frame - a Frame object.List object.public static org.objectweb.asm.tree.InsnList copy(org.objectweb.asm.tree.InsnList orig)
copy
orig - a InsnList object.InsnList object.public static void addPrimitiveDistanceCheck(org.objectweb.asm.tree.InsnList distance,
org.objectweb.asm.Type type,
org.objectweb.asm.tree.InsnList mutant)
addPrimitiveDistanceCheck
distance - a InsnList object.type - a Type object.mutant - a InsnList object.public static void addReferenceDistanceCheck(org.objectweb.asm.tree.InsnList distance,
org.objectweb.asm.Type type,
org.objectweb.asm.tree.InsnList mutant)
addReferenceDistanceCheck
distance - a InsnList object.type - a Type object.mutant - a InsnList object.public org.objectweb.asm.tree.InsnList getInfectionDistance(org.objectweb.asm.Type type,
org.objectweb.asm.tree.AbstractInsnNode original,
org.objectweb.asm.tree.InsnList mutant)
getInfectionDistance
type - a Type object.original - a AbstractInsnNode object.mutant - a InsnList object.InsnList object.public static double getDistance(double val1,
double val2)
getDistance
val1 - a double.val2 - a double.public static org.objectweb.asm.tree.InsnList cast(org.objectweb.asm.Type from,
org.objectweb.asm.Type to)
from - the type of the top stack valueto - the type into which this value must be cast.InsnList object.public static boolean canUse(Field f)
f - public boolean isApplicable(BytecodeInstruction instruction)
isApplicable in interface MutationOperatorinstruction - a BytecodeInstruction object.Copyright © 2010–2017 EvoSuite. All rights reserved.