Skip to content
mutastic

Changed lines, other tests and suites

--since=main mutates only the lines changed since the branch left main (its merge-base), uncommitted edits and new files included: a pull request’s or an agent’s change, which is where a missed mutant is worth acting on. A bare --since means the repository’s default branch. The summary says what the run covered (Changed 12 lines in 3 files since main); a scoped run writes its reports but doesn’t replace the last full run’s record.

A module’s own tests are often not all that test it: another module that uses it may test it more. --tests-from=:app (as often as needed) runs :app’s tests over the mutants the module’s own tests leave uncaught, as :app’s build runs them, with this module’s mutated classes in place of its jar; a mutant caught by either is caught. mutastic run :core --tests-from=:app, or --tests-from=dependents for every module that depends on this one, directly or through others, as the build’s own graph has it.

A module’s tests aren’t always in one suite: integration tests often live apart, in a suite of their own that checks what the unit tests leave out. --suite picks which suite’s tests run, test unless set:

Build--suiteRuns
Gradletest, or any Test task’s name, integrationTest sayThat task’s tests, from its own source set, with its JDK, JVM arguments, classpath and environment
MaventestSurefire’s tests, as mvn test runs them
Mavenintegration-test (or integrationTest)Failsafe’s tests, *IT by default, as its integration-test goal runs them
Terminal window
mutastic run --suite=integrationTest

From a build plugin, -Pmutastic.suite=integrationTest or -Dmutastic.suite=integration-test for one run, or for every run suite = "integrationTest" in mutastic { }, or <suite>integration-test</suite> in the Maven plugin’s configuration. A suite the build doesn’t have is an error that lists those it does.

A suite but test keeps its own run record and reports, under suites/<name>/ in the module’s work directory (build/mutastic/suites/integrationTest/), so its runs compare only with its own. The commands a run offers keep the suite: mutastic verify m2f3930a4 --suite=integrationTest checks a mutant against the tests that found it.

With --only=<id> the run is about one mutant, so it passes when that mutant is caught (or skipped, with nothing to catch), as verify does, and says the mutant’s fate rather than a score.