Skip to content
master
Go to file
Code

Latest commit

* Add greedy quantifier regex mutator

In regex c{5,8} checks if character c matches 5 to 8 times consecutively. We can mutate this to c{4,8}, c{6,8}, c{5,7}, and c{5,9} to test edge cases. Invalid cases are skipped. E.g. when the end value becomes less than the start c{4,3} or the start becomes lower than 0 c{-1,3}.

Solves part of this issue:
#1228

* Add greedy unlimited quantifier regex mutator

In regex c{5,} checks if character c matches 5 to unlimited times consecutively. We can mutate this to c{4,} and c{6,}  to test edge cases. The mutation is skipped when the value becomes lower than zero.

Solves the final part of this issue:
#1228

Co-authored-by: Pim van Gurp <pim@pimify.nl>
Co-authored-by: Richard Werkman <Richard1158@gmail.com>
e23dd4b

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Nuget Nuget Azure DevOps build Azure DevOps tests Slack

Stryker.NET

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

Stryker offers mutation testing for your .NET Core and .NET Framework projects. It allows you to test your tests by temporarily inserting bugs in your source code

For an introduction to mutation testing and Stryker's features, see stryker-mutator.io. Looking for mutation testing in JavaScript & Typescript or Scala?

Getting started

Stryker is installed using NuGet as a dotnet core tool

Read more

Install globally

dotnet tool install -g dotnet-stryker

Install in project

Starting from dotnet core 3.0 dotnet tools can also be installed on a project level. This requires the following steps:

Create a file called dotnet-tools.json in your project folder

dotnet new tool-manifest

Then install stryker without the -g flag by executing the following command in the project folder

dotnet tool install dotnet-stryker

Check the dotnet-tools.json file into source control

Now the rest of your team can install or update stryker with the following command: dotnet tool restore

Now you can run stryker from your test project directory by executing:

dotnet stryker

Updating stryker

Dotnet tools do not auto update so you are responsible for making sure you're up-to-date. To help with this stryker will notify you when a new version is available

To update stryker as a global tool run dotnet tool update --global dotnet-stryker

To update stryker as a project tool run dotnet tool update --local dotnet-stryker or change the version in the dotnet-tools.json file. Then check in the updated dotnet-tools.json file.

Documentation

For the full documentation on how to use Stryker.NET, see our configuration docs

Compatibility

Runs on test projects targeting:

  • netcoreapp 1.1+
  • netframework 4.5+

Requirements

Dotnet core runtime 3.1+ needs to be available on your system to run dotnet stryker.

For .NET Framework projects, Stryker.NET requires nuget.exe to be installed on your system. Please follow their installation instructions.

Supported Mutators

Right now, Stryker.NET supports the following mutations:

  • Arithmetic Operators
  • Equality Operators
  • Boolean Literals
  • Assignment statements
  • Collection initialization
  • Unary Operators
  • Update Operators
  • Checked Statements
  • Linq Methods
  • String Literals
  • Bitwise Operators

For the full list of all available mutations, see the mutator docs.

Supported Reporters

  • Html reporter
  • Dashboard reporter
  • Console reporter
  • Progress reporter
  • Console dots reporter
  • Json reporter

For the full list of all available reporters, see the reporter docs.

Contributing

Want to help develop Stryker.NET? Check out our contribution guide.

Issues for the HTML report should be issued at https://github.com/stryker-mutator/mutation-testing-elements

You can’t perform that action at this time.