Skip to content
mutastic

Plugin API

A plugin is a jar built against these types. Depend on them for compiling only: mutastic provides them when it loads the plugin. This reference is written from the API's own doc comments.

io.mutastic.api

In io.mutastic:mutastic-api.

BuildToolinterfaceA build tool mutastic reads a project’s setup from, found with java.util.ServiceLoader: each is asked in turn whether a directory is one of its builds.
BuildTool.RequestrecordWhat to read: a module of the build in directory, and which of its test suites.
BuildTool.SetupFailedclassThe build couldn’t be read: the message says what to do instead.
BuiltInenummutastic’s own operators.
ChangedLinesrecordThe source lines a change touched, by file: what a run scoped to a change mutates.
ComparisonrecordThis run against the last one.
Comparison.FliprecordA mutant caught in one run and not the other.
CoveragePassrecordWhat the coverage pass found, before any mutant runs.
FilterinterfaceDecides that a method’s mutants shouldn’t run, and says why.
FlakyTestrecordWhat a flaky test’s failure and reach say about why it’s flaky: the difference between a test that’s its own doing (an unseeded Random, the clock), which can be made to give the same answer every time, and one that reaches outside the code (the network, a database), where changing the test or the code to get past it would hide what’s wrong.
IgnorerecordA mutant the project has decided not to test, by id, from .mutastic/ignores.yaml: written by mutastic ignore, committed, and reviewed like code.
ListenerinterfaceHears about a run as it happens, for progress and streamed output.
MutantrecordOne mutation of one instruction: which method, which mutation site in it (counted in bytecode order), and what the instruction becomes.
MutantResultrecordOne mutant’s outcome.
MutatorinterfaceAn operator a plugin adds, or a rules file describes: which instructions it changes, how, and what a missed mutant’s card says.
Mutator.ChangerecordOne change at a site.
Mutator.SiterecordOne instruction, with the code around it.
Mutator.WordsrecordA missed mutant’s card, in words.
OperatorinterfaceA kind of change mutastic makes: one of its own (BuiltIn), or one a plugin or rules file adds (Mutator).
Operator.TierenumThe sets operators come in.
PolicyrecordA project’s own say over which mutants run: the mutants it ignores by id (from .mutastic/ignores.yaml), and from mutastic.yaml its rules, then filters of its own (found in its plugins, run only when named), after the built-in ones; which operators run, and the operators its plugins and rules files add.
ProjectrecordOne module’s code and tests, and how its build runs them: what a build-tool integration reads from the module’s test task.
ProjectSetupclassThe setup file a build tool’s own code writes from inside the build (Gradle’s init script, Maven’s extension): a properties file with what the module’s tests run with.
ReportrecordA finished run: every mutant’s result, in the order they were found.
RulerecordA project’s own decision, from mutastic.yaml: skip the mutants in some code, or mutate code a built-in filter would skip as arid, with the reason.
SkiprecordWhy a mutant doesn’t run.
Skip.KindenumWhat the skip claims: GENERATED, EQUIVALENT and UNVIABLE are facts about the bytecode (an unviable change wouldn’t load); ARID is a judgement that the mutant isn’t worth a test; USER is the project’s own decision.
StatusenumWhat happened to a mutant.
SuggestionrecordA call that tells a missed mutant from the code today, found by running both: the test to write is an assertion of today’s value.
Suggestion.InstancerecordAn instance a suggestion makes: its class’s simple name and constructor arguments, Window and [5, 10].
TestSelectionrecordWhich of a module’s tests its build runs: the test task’s or Surefire’s patterns and JUnit tags.

io.mutastic.annotations

In io.mutastic:mutastic-annotations.

Annotations for code mutastic tests: DoNotMutate to skip, DoMutate to keep what would be skipped. Read from the class files, so they cost nothing at run time.

DoMutateannotationmutastic mutates this method, or every method of this class, even where it would skip it as arid: a toString() that customers see, a getter that is a contract.
DoNotMutateannotationmutastic skips the mutants in this method, or in every method of this class, and reports them as skipped with value as the reason: @DoNotMutate("measured by the load tests").