public class HigherOrderMutant extends AbstractMutant
This class is used to represent a higher order mutated class.
It holds the injected faults into a the HOM (higher order mutant) that
it presents using first_order_mutants
This class can be transformed to .java file that contains either the HOM or the original code that it presents.
All the constructors of this class are private, to create an object of this
class use build(String)
AbstractMutant,
FirstOrderMutant| Modifier and Type | Field and Description |
|---|---|
static double |
SUBTLE_DEGREE
The degree that the
fitness should
equal or exceed to be considered as subtle HigherOrderMutant |
| Constructor and Description |
|---|
HigherOrderMutant() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFirstOrderMutant(FirstOrderMutant mutant) |
static HigherOrderMutant |
build(java.lang.String originalPath) |
int |
compareTo(AbstractMutant abstractMutant)
Sorts based on
HigherOrderMutant's fitness |
HigherOrderMutant |
copy() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getCode()
Each
HigherOrderMutant has a Set of FirstOrderMutants, as each FirstOrderMutant
holds the path to the mutated and the original .java files, this method reads these
files and spots the differences between these two files (the original and the mutated)
and applies these differences to a copy of the original file. |
java.util.List<FirstOrderMutant> |
getFirstOrderMutants() |
java.util.Set<java.lang.String> |
getFirstOrderMutantsKilledBy() |
java.lang.String |
getId()
Sets the id on the
HigherOrderMutant based on the FirstOrderMutants it is created from |
int |
getOrder()
The degree of a
HigherOrderMutant is the count of its FirstOrderMutants |
java.lang.String |
getOriginalCode() |
boolean |
isSubtle() |
void |
removeFirstOrderMutant(FirstOrderMutant mutant) |
void |
setFirstOrderMutants(java.util.Collection<FirstOrderMutant> mutants) |
addKilledBy, clearKilledBy, getKilledBy, isLive, isNonCompiled, setKilledBypublic static final double SUBTLE_DEGREE
fitness should
equal or exceed to be considered as subtle HigherOrderMutantisSubtle(),
Constant Field Valuespublic static HigherOrderMutant build(java.lang.String originalPath)
originalPath - of the file that this mutant representsHigherOrderMutantpublic HigherOrderMutant copy()
HigherOrderMutantpublic java.lang.String getId()
HigherOrderMutant based on the FirstOrderMutants it is created fromHigherOrderMutantpublic int getOrder()
HigherOrderMutant is the count of its FirstOrderMutantsgetOrder in class AbstractMutantpublic java.lang.String getCode()
Each HigherOrderMutant has a Set of FirstOrderMutants, as each FirstOrderMutant
holds the path to the mutated and the original .java files, this method reads these
files and spots the differences between these two files (the original and the mutated)
and applies these differences to a copy of the original file.
getCode in class AbstractMutantHigherOrderMutant representspublic void addFirstOrderMutant(FirstOrderMutant mutant)
mutant - FirstOrderMutant to be added to this HigherOrderMutantpublic void removeFirstOrderMutant(FirstOrderMutant mutant)
mutant - FirstOrderMutant to be removed from this HigherOrderMutantpublic java.util.List<FirstOrderMutant> getFirstOrderMutants()
List of FirstOrderMutants that this HigherOrderMutant is created frompublic void setFirstOrderMutants(java.util.Collection<FirstOrderMutant> mutants)
mutants - to replace all the current FirstOrderMutantspublic java.util.Set<java.lang.String> getFirstOrderMutantsKilledBy()
FirstOrderMutants that this HigherOrderMutant is created frompublic java.lang.String getOriginalCode()
HigherOrderMutant representspublic int compareTo(AbstractMutant abstractMutant)
HigherOrderMutant's fitnesscompareTo in interface java.lang.Comparable<AbstractMutant>compareTo in class AbstractMutantComparable.compareTo(java.lang.Object)public boolean isSubtle()
isSubtle in class AbstractMutantSUBTLE_DEGREEpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object