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.
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+
Right now, Stryker.NET supports the following mutators:
- Binary Operators
- Boolean Substitutions
- Assignment Mutator
- Unary Operators
- Update Operators
- Checked Mutator
- LINQ Mutator
- String Mutator
For the full list of all available mutators, see the Stryker.Core readme.
Want to help develop Stryker.NET? Check out our contribution guide.