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 default arguments. #2848

Open Liam-Rougoor opened 4 months ago

Liam-Rougoor commented 4 months ago

Is your feature request related to a problem? Please describe. Default parameters could not be mutated in the method declaration due to the cause of compile errors. However, since the semantic model was introduced, we could mutate method invocations that make use of default parameters.

Describe the solution you'd like I'd like to see a mutator that mutates method invocations that use default parameters.

Additional context An example:

void myMethodWithDefaultParameter(string defaultParam = "Hello Stryker!"){
...
}

When the method is called like this: myMethodWithDefaultParameter();

I'd expect a mutation like: myMehodWithDefaultParameter("");