stryker-mutator / stryker-net

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

Linq mutator mutates Count to Sum #2762

Open richardwerkman opened 9 months ago

richardwerkman commented 9 months ago

Describe the bug Count is being mutated into Sum, but this results in invalid mutations most of the time.

image

Expected behavior This is only a valid mutation in the case of an enumerable of numbers. Otherwise, this will always result in invalid muations. Maybe we can think of another mutation that does make sense in more cases. Or remove this mutation.

Context This mutation was added in the original Linq mutator implementation #185

dupdob commented 9 months ago

this may be addressed thanks to semantic context, which could identify when this is a numerical enumeration