sofya.mutator.operators
Class HFR.HFRMutation

java.lang.Object
  extended by sofya.mutator.MutationImpl
      extended by sofya.mutator.ClassMutation
          extended by sofya.mutator.operators.HFR.HFRMutation
All Implemented Interfaces:
Mutation
Enclosing class:
HFR

public static class HFR.HFRMutation
extends ClassMutation


Nested Class Summary
 
Nested classes/interfaces inherited from interface sofya.mutator.Mutation
Mutation.Variant
 
Constructor Summary
protected HFR.HFRMutation(java.lang.String className, java.lang.String fieldName, java.lang.String overriddenParent)
           
 
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, 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.
 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.
 java.lang.String toString()
           
 void undo(org.apache.bcel.generic.ClassGen cg)
          Reverses the actions performed to apply this mutation.
 
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
 

Constructor Detail

HFR.HFRMutation

protected HFR.HFRMutation(java.lang.String className,
                          java.lang.String fieldName,
                          java.lang.String overriddenParent)
Method Detail

getType

public java.lang.String getType()
Description copied from interface: Mutation
Gets the operator type abbreviation associated with this mutation.

Returns:
The operator type that generated this mutation.

getDefaultVariant

public Mutation.Variant getDefaultVariant()
Description copied from interface: Mutation
Gets the default variant selected by the mutation generator when the mutation table was generated.

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.

Returns:
A variant of this mutation selected during mutation table generation. Mutations that do not support variants may return null from this method.

getVariants

public Mutation.Variant[] getVariants()
Description copied from interface: Mutation
Gets all of the possible variants of this 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.

Returns:
An array of the possible variants of this mutation.

accept

public void accept(MutationVisitor visitor)
            throws MutationException
Description copied from interface: Mutation
Accepts a mutation visitor to perform some operation using this mutation.

Parameters:
visitor - Mutation visitor that is visiting this mutation.
Throws:
MutationException - If an action performed on this mutation by the visitor fails (this permits the exception to propagate).

apply

public void apply(org.apache.bcel.generic.ClassGen cg,
                  Mutation.Variant variant)
           throws MutationException
Description copied from interface: Mutation
Applies this mutation to the class file.

Parameters:
cg - BCEL classfile object for the class being mutated.
variant - Index of the variant of the mutation to be applied.
Throws:
MutationException - If application of this mutation fails for any reason.

undo

public void undo(org.apache.bcel.generic.ClassGen cg)
Description copied from interface: Mutation
Reverses the actions performed to apply this mutation. This method is used by the Mutator to automatically screen out illegal mutants when mutant verification is enabled.

Parameters:
cg - BCEL classfile object for the class to which this mutation was applied.

serialize

public void serialize(java.io.DataOutput out)
               throws java.io.IOException
Description copied from interface: Mutation
Serializes this 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.

Parameters:
out - Data output sink to which the mutation should be serialized.
Throws:
java.io.IOException - If serialization of this mutation fails for any I/O related reason.

deserialize

public static Mutation deserialize(java.io.DataInput in)
                            throws java.io.IOException
Throws:
java.io.IOException

print

public java.lang.String print()
Description copied from interface: Mutation
Prints this mutation in a format suitable for display.

Returns:
A string giving information about the mutation in a format suitable for display.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object