|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sofya.mutator.MutationImpl sofya.mutator.MethodMutation sofya.mutator.operators.ROP.ROPMutation
public static class ROP.ROPMutation
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface sofya.mutator.Mutation |
---|
Mutation.Variant |
Field Summary |
---|
Fields inherited from class sofya.mutator.MethodMutation |
---|
className, methodName, signature |
Constructor Summary | |
---|---|
protected |
ROP.ROPMutation(java.lang.String className,
java.lang.String methodName,
java.lang.String signature,
int codeOffset,
int relOffset,
short origOpcode,
short mutatedOpcode)
|
Method Summary | |
---|---|
void |
accept(MutationVisitor visitor)
Accepts a mutation visitor to perform some operation using this mutation. |
void |
apply(org.apache.bcel.generic.ClassGen cg,
org.apache.bcel.generic.MethodGen mg,
org.apache.bcel.generic.InstructionList il,
java.util.Map linkData,
Mutation.Variant variant)
Applies the mutation; provides access to data to enable more efficient application. |
void |
apply(org.apache.bcel.generic.ClassGen cg,
Mutation.Variant variant)
Applies this mutation to the class file. |
static Mutation |
deserialize(java.io.DataInput in)
|
Mutation.Variant |
getDefaultVariant()
Gets the default variant selected by the mutation generator when the mutation table was generated. |
MutationGroup |
getParent()
Gets the parent mutation group of which this mutation is a member. |
java.lang.String |
getType()
Gets the operator type abbreviation associated with this mutation. |
Mutation.Variant[] |
getVariants()
Gets all of the possible variants of this mutation. |
java.lang.String |
print()
Prints this mutation in a format suitable for display. |
void |
serialize(java.io.DataOutput out)
Serializes this mutation. |
void |
setParent(MutationGroup mg)
Sets the parent mutation group of which this mutation is a member. |
java.lang.String |
toString()
|
void |
undo(org.apache.bcel.generic.ClassGen cg)
Reverses the actions performed to apply this mutation. |
void |
undo(org.apache.bcel.generic.ClassGen cg,
org.apache.bcel.generic.MethodGen mg,
org.apache.bcel.generic.InstructionList il,
java.util.Map linkData)
Reverses the actions performed to apply this mutation; provides access to the additional data used by this mutation for appropriate reversal of changes. |
Methods inherited from class sofya.mutator.MethodMutation |
---|
getClassName, getMethodName, getSignature |
Methods inherited from class sofya.mutator.MutationImpl |
---|
getID, setID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface sofya.mutator.Mutation |
---|
getID, setID |
Constructor Detail |
---|
protected ROP.ROPMutation(java.lang.String className, java.lang.String methodName, java.lang.String signature, int codeOffset, int relOffset, short origOpcode, short mutatedOpcode)
Method Detail |
---|
public java.lang.String getType()
Mutation
getType
in interface Mutation
public MutationGroup getParent()
GroupableMutation
getParent
in interface GroupableMutation
null
, in which case efficiency benefits associated
with implementing the GroupableMutation
interface will
be lost.public void setParent(MutationGroup mg)
GroupableMutation
This method is automatically invoked when this mutation is added to a mutation group. It should not normally be called otherwise.
setParent
in interface GroupableMutation
mg
- Mutation group that now contains this mutation.public Mutation.Variant getDefaultVariant()
Mutation
A default variant ensures that a mutation can be applied without requiring user intervention. The policy for selecting an initial default is determined by the generating mutation operator, and is typically random.
getDefaultVariant
in interface Mutation
null
from this method.public Mutation.Variant[] getVariants()
Mutation
A variant is one of set of mutually exclusive mutations that can be applied at the same code location. The simplest example of this is an operator mutation, where mutliple alternate operators can be substituted to produce a mutant.
getVariants
in interface Mutation
public void accept(MutationVisitor visitor) throws MutationException
Mutation
accept
in interface Mutation
visitor
- Mutation visitor that is visiting this mutation.
MutationException
- If an action performed on this mutation by the
visitor fails (this permits the exception to propagate).public void apply(org.apache.bcel.generic.ClassGen cg, Mutation.Variant variant) throws MutationException
Mutation
apply
in interface Mutation
cg
- BCEL classfile object for the class being mutated.variant
- Index of the variant of the mutation to be applied.
MutationException
- If application of this mutation fails for any
reason.public void apply(org.apache.bcel.generic.ClassGen cg, org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.InstructionList il, java.util.Map linkData, Mutation.Variant variant) throws MutationException
GroupableMutation
apply
in interface GroupableMutation
cg
- BCEL classfile object for the class being mutated.mg
- BCEL method object for the method being mutated.il
- BCEL instruction list for the method being mutated.linkData
- Map to permit grouped mutations to pass information to
each other.variant
- Index of the variant of the mutation to be applied.
MutationException
- If application of this mutation fails for any
reason.public void undo(org.apache.bcel.generic.ClassGen cg)
Mutation
Mutator
to automatically screen out illegal
mutants when mutant verification is enabled.
undo
in interface Mutation
cg
- BCEL classfile object for the class to which this mutation
was applied.public void undo(org.apache.bcel.generic.ClassGen cg, org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.InstructionList il, java.util.Map linkData)
GroupableMutation
Mutator
to
automatically screen out illegal mutants when mutant verification
is enabled.
undo
in interface GroupableMutation
cg
- BCEL classfile object for the class to which this mutation
was applied.mg
- BCEL method object for the method to which this mutation
was applied.il
- BCEL instruction list for the method to which this mutation
was applied.linkData
- Map used to permit grouped mutations to pass information
to each other.public void serialize(java.io.DataOutput out) throws java.io.IOException
Mutation
A mutation class should also provide a static method named
deserialize
that takes a single parameter of type
DataInput
and returns a Mutation. This method is
used by the framework to provide transparent automatic support
for new mutation operators, though it cannot be enforced by
the interface due to the need for a static method.
serialize
in interface Mutation
out
- Data output sink to which the mutation should be serialized.
java.io.IOException
- If serialization of this mutation fails for any
I/O related reason.public static Mutation deserialize(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public java.lang.String print()
Mutation
print
in interface Mutation
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |