Mutation testing is a type of software testing where we mutate (change) certain expressions in the source code and check if the test cases are able to find the errors. It is a type of White Box Testing which is mainly used for Unit Testing.
Blinky has 3 main steps:
- Copy the git project to a temporary folder (where the source code can be safely modified)
- Run the scalafix tool with the Blinky rule (on the copy project)
- Run the project tests on the mutated code (usually with only 1 mutant active each time)
We use Blinky to test this repository, improving the test code quality.
The main difference is that in Blinky the mutations are semantic instead of just syntactic.
Meaning when using a rule like
ScalaOptions.filter we only mutate calls to
filter of objects of type
In order to have this semantic information about the types Blinky
needs the semanticdb
data of all files that we want to mutate.
Head over to the user docs for instructions on how to install blinky.
Create a new scalafix executable after upgrading scalafix dependency with:
coursier bootstrap ch.epfl.scala:scalafix-cli_2.13.8:0.9.34 -f --main scalafix.cli.Cli -o scalafix