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.
For an introduction to mutation testing and Stryker's features, see stryker-mutator.io. Looking for mutation testing in JavaScript?
Stryker.NET offers you mutation testing for your .NET Core projects. It allows you to test your tests by temporarily inserting bugs. Stryker.NET is installed using NuGet.
To install Stryker.NET on your test project add the following lines to the root of your .csproj
file. on your test project.
<ItemGroup>
<DotNetCliToolReference Include="StrykerMutator.DotNetCoreCli" Version="*" />
<PackageReference Include="StrykerMutator.DotNetCoreCli" Version="*" />
</ItemGroup>
After adding the references, install the packages by executing dotnet restore
inside the project folder.
Stryker.NET can be used by executing the dotnet stryker
command inside your test project folder, using the Stryker.CLI package.
For the full documentation on how to use Stryker.NET, see the Stryker.CLI readme.
Only compatible with .NET Core version 1.1+
Dotnet core runtime 2.1 needs to be available on your system to run dotnet stryker
Right now, Stryker.NET supports the following mutations:
- Arithmetic Operators
- Equality Operators
- Boolean Literals
- Assignment statements
- Unary Operators
- Update Operators
- Checked Statements
- Linq Methods
- String Literals
For the full list of all available mutations, see the Stryker.Core readme.
Want to help develop Stryker.NET? Check out our contribution guide.