stryker-mutator/stryker4s
{ "createdAt": "2018-06-20T14:14:40Z", "defaultBranch": "master", "description": "Mutation testing for Scala", "fullName": "stryker-mutator/stryker4s", "homepage": "https://stryker-mutator.io", "language": "Scala", "name": "stryker4s", "pushedAt": "2026-07-15T16:08:02Z", "stargazersCount": 212, "topics": [ "cats-effect", "hacktoberfest", "maven-plugin", "mill-plugin", "mutation-testing", "sbt", "sbt-plugin", "scala", "stryker", "test-automation", "testing", "testing-tools", "unit-testing" ], "updatedAt": "2026-07-15T19:16:55Z", "url": "https://github.com/stryker-mutator/stryker4s"}
Stryker4s
Section titled “Stryker4s”Professor X: For someone who hates mutants… you certainly keep some strange company.
William Stryker: Oh, they serve their purpose… as long as they can be controlled.
Introduction
Section titled “Introduction”For an introduction to mutation testing and Stryker’s features, see stryker-mutator.io. Looking for mutation testing in JavaScript or .NET?
Getting Started
Section titled “Getting Started”For the quickstart, see our website’s quickstart.
Stryker4s is a mutation testing framework for Scala. It allows you to test your tests by temporarily inserting bugs. Depending on your project setup, there are multiple ways to get started with Stryker4s.
Sbt plugin
Section titled “Sbt plugin”Stryker4s provides a sbt plugin for easy use within sbt projects. To install the plugin, add the following line to plugins.sbt :
addSbtPlugin("io.stryker-mutator" % "sbt-stryker4s" % stryker4sVersion)After adding the plugin, Stryker4s can be used by running sbt stryker in the root of your project.
Multi-module projects
Section titled “Multi-module projects”Multi-module projects are fully supported. Run Stryker on the desired module by running sbt <module-name>/stryker.
Maven plugin
Section titled “Maven plugin”The Maven plugin can be added as follows in pom.xml under <plugins> :
<plugin> <groupId>io.stryker-mutator</groupId> <artifactId>stryker4s-maven-plugin</artifactId> <version>${stryker4s.version}</version></plugin>You can then run Stryker4s with the command mvn stryker4s:run. Note that this is different than the command for the sbt plugin.
The Maven plugin discovers tests through the sbt.testing interface, so your test framework needs to ship one (munit, ScalaTest, specs2, weaver, utest, ZIO Test, ScalaCheck, …). Surefire/JUnit-native test discovery is not supported yet. JUnit should have the junit-interface as a dependency.
Mill plugin
Section titled “Mill plugin”Stryker4s provides a plugin for the Mill build tool. Import the plugin in your build.mill and mix the Stryker4sModule trait into the ScalaModule you want to mutation test :
//| mvnDeps://| - io.stryker-mutator::mill-stryker4s::<version>package buildimport mill.*, scalalib.*import stryker4s.mill.Stryker4sModule
object foo extends ScalaModule, Stryker4sModule { // ... object test extends ScalaTests { // ... }}You can then run Stryker4s with ./mill foo.stryker, where foo is the name of your module. The tests of the module are run via its first child test module (e.g. object test extends ScalaTests); override strykerTestModule to point it elsewhere.
Configuration is read from stryker-prefixed overrides on the module (e.g. def strykerConcurrency = Some(4)), from stryker4s.conf, or from command-line arguments (e.g. ./mill foo.stryker --thresholds.break 80).
Pre-release versions
Section titled “Pre-release versions”We also publish SNAPSHOT versions of each commit on master. To use a pre-release, add the following setting to your build.sbt and plugins.sbt:
resolvers += Resolver.sonatypeCentralSnapshotsThen replace the Stryker4s version with this version: .
Configuration
Section titled “Configuration”See the configuration page for all the configuration options available in Stryker4s.
Supported mutators
Section titled “Supported mutators”Stryker4s supports a variety of mutators, which can be found here. Do you have a suggestion for a (new) mutator? Feel free to create an issue!
An always up-to-date reference is also available in the [MutantMatcher source]!(modules/core/src/main/scala/stryker4s/mutants/findmutants/MutantMatcher.scala).
Changelog
Section titled “Changelog”See the releases page for all the latest changes made.
Contributing
Section titled “Contributing”Want to contribute? That’s great! Please have a look at our contributing guide.