|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GroupableMutation
Marks a mutation as groupable, which indicates that the mutation can be applied to the bytecode of a particular method at the same time as other mutations (usually of the same type).
Implementing this interface allows suitable mutations to be applied more efficiently, typically by allowing all of the mutations to be applied in one pass over the method's instruction list, rather than repeatedly seeking to the right position, applying the mutation, and committing the changed bytecode. Mutations implementing this interface are of course permitted to take advantage of other optimizations that may be feasible as well.
Note that a mutation implementing this interface must be added
to a MutationGroup
or the efficiency benefit is lost.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface sofya.mutator.Mutation |
---|
Mutation.Variant |
Method Summary | |
---|---|
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. |
MutationGroup |
getParent()
Gets the parent mutation group of which this mutation is a member. |
void |
setParent(MutationGroup mg)
Sets the parent mutation group of which this mutation is a member. |
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 interface sofya.mutator.Mutation |
---|
accept, apply, getDefaultVariant, getID, getType, getVariants, print, serialize, setID, undo |
Method Detail |
---|
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
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.void undo(org.apache.bcel.generic.ClassGen cg, org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.InstructionList il, java.util.Map linkData)
Mutator
to
automatically screen out illegal mutants when mutant verification
is enabled.
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.MutationGroup getParent()
null
, in which case efficiency benefits associated
with implementing the GroupableMutation
interface will
be lost.void setParent(MutationGroup mg)
This method is automatically invoked when this mutation is added to a mutation group. It should not normally be called otherwise.
mg
- Mutation group that now contains this mutation.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |