stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.75k stars 176 forks source link

Mutator for numbers #2849

Open Liam-Rougoor opened 4 months ago

Liam-Rougoor commented 4 months ago

Is your feature request related to a problem? Please describe. Similar to the StringMutator, we could mutate numbers.

Describe the solution you'd like I'd like to see a mutator for numbers. Example mutations could be: Original Mutation
var x = 10; var x = 0;
var x = 10; var x = -10;
With semantic model, we could add some mutations on numeric variables as well: Original Mutation
var x = myNumericVariable; var x = -myNumericVariable;

This example might be bad if myNumericVariable equals 0..

richardwerkman commented 4 months ago

That mutation on numeric variables is less useful, and prone to unkillable mutants. But the first ones we could definitely add.