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 FirstOrderMutant s, 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 FirstOrderMutant s it is created from |
int |
getOrder()
The degree of a
HigherOrderMutant is the count of its FirstOrderMutant s |
java.lang.String |
getOriginalCode() |
boolean |
isSubtle() |
void |
removeFirstOrderMutant(FirstOrderMutant mutant) |
void |
setFirstOrderMutants(java.util.Collection<FirstOrderMutant> mutants) |
addKilledBy, clearKilledBy, getKilledBy, isLive, isNonCompiled, setKilledBy
public static final double SUBTLE_DEGREE
fitness
should
equal or exceed to be considered as subtle HigherOrderMutant
isSubtle()
,
Constant Field Valuespublic static HigherOrderMutant build(java.lang.String originalPath)
originalPath
- of the file that this mutant representsHigherOrderMutant
public HigherOrderMutant copy()
HigherOrderMutant
public java.lang.String getId()
HigherOrderMutant
based on the FirstOrderMutant
s it is created fromHigherOrderMutant
public int getOrder()
HigherOrderMutant
is the count of its FirstOrderMutant
sgetOrder
in class AbstractMutant
public java.lang.String getCode()
Each HigherOrderMutant
has a Set of FirstOrderMutant
s, 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 AbstractMutant
HigherOrderMutant
representspublic void addFirstOrderMutant(FirstOrderMutant mutant)
mutant
- FirstOrderMutant
to be added to this HigherOrderMutant
public void removeFirstOrderMutant(FirstOrderMutant mutant)
mutant
- FirstOrderMutant
to be removed from this HigherOrderMutant
public java.util.List<FirstOrderMutant> getFirstOrderMutants()
List
of FirstOrderMutant
s that this HigherOrderMutant
is created frompublic void setFirstOrderMutants(java.util.Collection<FirstOrderMutant> mutants)
mutants
- to replace all the current FirstOrderMutant
spublic java.util.Set<java.lang.String> getFirstOrderMutantsKilledBy()
FirstOrderMutant
s 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 AbstractMutant
Comparable.compareTo(java.lang.Object)
public boolean isSubtle()
isSubtle
in class AbstractMutant
SUBTLE_DEGREE
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object