Mutator
interface in io.mutastic.api
non-sealed interface Mutator extends OperatorAn operator a plugin adds, or a rules file describes: which instructions it changes, how, and
what a missed mutant’s card says. Plugins provide theirs as a java.util.ServiceLoader service,
in a jar mutastic.yaml lists under plugins:.
Each mutant’s id is made from its method, its site and its change’s label, with the operator’s id, so a change’s label must never change once released. A call operator’s sites are calls, counted as the built-in call operators count them; any other operator’s are every instruction in the method, counted in order.
Methods
changes
List<Mutator.Change> changes(Mutator.Site site)The changes this operator makes at site, each by its label; none when it doesn’t apply.
write
void write(CodeBuilder builder, Instruction instruction, String label)Writes instruction in its place, changed as label says. The stack afterwards must hold
what the original left; a change that doesn’t verify is skipped as unviable, never run.
words
Mutator.Words words(Mutant mutant)What a missed mutant’s card says.
tier
default Operator.Tier tier()