https://github.com/stryker-mutator/stryker4s
Mutation testing for Scala
https://github.com/stryker-mutator/stryker4s
cats-effect hacktoberfest mutation-testing sbt sbt-plugin scala stryker test-automation testing testing-tools unit-testing
Last synced: about 1 month ago
JSON representation
Mutation testing for Scala
- Host: GitHub
- URL: https://github.com/stryker-mutator/stryker4s
- Owner: stryker-mutator
- License: apache-2.0
- Created: 2018-06-20T14:14:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T22:19:36.000Z (about 1 year ago)
- Last Synced: 2024-04-14T12:23:46.127Z (about 1 year ago)
- Topics: cats-effect, hacktoberfest, mutation-testing, sbt, sbt-plugin, scala, stryker, test-automation, testing, testing-tools, unit-testing
- Language: Scala
- Homepage: https://stryker-mutator.io
- Size: 2.86 MB
- Stars: 193
- Watchers: 7
- Forks: 36
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/contributing.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-scala - stryker4s - mutator/stryker4s)  (Table of Contents / Testing)
- fucking-awesome-scala - stryker4s - mutator/stryker4s)  (Table of Contents / Testing)
- fucking-awesome-scala - stryker4s - mutator/stryker4s)  (Table of Contents / Testing)
README
[](https://search.maven.org/search?q=g:io.stryker-mutator)
[](https://github.com/stryker-mutator/stryker4s/actions)
[](https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/stryker4s/master)
[](https://join.slack.com/t/stryker-mutator/shared_invite/enQtOTUyMTYyNTg1NDQ0LTU4ODNmZDlmN2I3MmEyMTVhYjZlYmJkOThlNTY3NTM1M2QxYmM5YTM3ODQxYmJjY2YyYzllM2RkMmM1NjNjZjM)
# 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
For an introduction to mutation testing and Stryker's features, see [stryker-mutator.io](https://stryker-mutator.io/). Looking for mutation testing in [JavaScript](https://github.com/stryker-mutator/stryker) or [.NET](https://github.com/stryker-mutator/stryker-net)?
## Getting Started
For the quickstart, see [our website's quickstart](https://stryker-mutator.io/stryker4s/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
Stryker4s provides a sbt plugin for easy use within sbt projects. To install the plugin, add the following line to `plugins.sbt` [](https://search.maven.org/artifact/io.stryker-mutator/sbt-stryker4s):
```scala
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
Multi-module projects are not yet fully supported. However, there is a workaround you can use while we work on a better solution. Set the base-directory to the correct directory of the submodule with the [`base-dir` configuration setting](https://stryker-mutator.io/docs/stryker4s/configuration#base-dir-string). Then you can run `sbt "project yourSubmoduleNameHere" stryker` to set the active project and run Stryker4s.
## Maven plugin
The Maven plugin can be added as follows in `pom.xml` under `` [](https://search.maven.org/artifact/io.stryker-mutator/stryker4s-maven-plugin):
```xml
io.stryker-mutator
stryker4s-maven-plugin
${stryker4s.version}```
You can then run Stryker4s with the command `mvn stryker4s:run`. Note that this is different than the command for the sbt plugin.
## 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`:
```scala
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
```Then replace the Stryker4s version with this version: [](https://oss.sonatype.org/content/repositories/snapshots/io/stryker-mutator/).
## Configuration
See the [configuration page](https://stryker-mutator.io/docs/stryker4s/configuration) for all the configuration options available in Stryker4s.
## Supported mutators
Stryker4s supports a variety of mutators, which can be found [here](https://stryker-mutator.io/docs/mutation-testing-elements/supported-mutators/).
Do you have a suggestion for a (new) mutator? Feel free to create an [issue](https://github.com/stryker-mutator/stryker4s/issues/new)!An always up-to-date reference is also available in the [MutantMatcher source](core/src/main/scala/stryker4s/mutants/findmutants/MutantMatcher.scala).
## Changelog
See the [releases page](https://github.com/stryker-mutator/stryker4s/releases) for all the latest changes made.
## Contributing
Want to contribute? That's great! Please have a look at our [contributing guide](https://stryker-mutator.io/docs/stryker4s/contributing).