Coverage analysis filter overwrites Ignored mutant statuses while it should ignore them
See original GitHub issueDescribe the bug Let’s say I have a project with two identical classes (attached to this ticket). Initially (initial commit, hash d242de36) I have poor test coverage:
dotnet stryker
This makes me sad, so I do some refactoring and add a bunch of tests for the first class (added some tests, hash b71bedf0). Now I have better score:
dotnet stryker
Numbers make sense. But when I run Stryker in diff mode against initial commit (in reality, that’s in PRs), the stats are odd:
dotnet stryker -diff -gdt d242de36580bc0e13f8ba3bd00065fb8e2ef0ca6
Expected behavior There are a few things wrong:
- Ideally, I wouldn’t want to see
Class2.cs
here at all, because it was not touched since diff target and Stryker apparently somehow takes this into account, ignoring some mutants in that class (and therefore making 0 score there). - Even if that must be there, where does the number 66.67 come from? AFAIU it should be 100% there, but I would understand 50% (incorrect but at least clearly 4/8 = 50%).
Desktop (please complete the following information):
- OS: Windows
- Type of project: .NET Core
- Framework Version: 5
- Stryker Version: beta 0.22.4
Additional context The code: StrykerDiff.zip
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Line-level @codeCoverageIgnore is not respected #709
Linebased @codeCoverageIgnore still does not work. Would it be possible to get linebased coverage ignore into Infection? PHPUnit coverage report.
Read more >Solved: Using Set Analysis to ignore filters
It makes sense, but I want make the current speed expression ignore filters, so it never disappears no matter the filter selections. Any...
Read more >Ignore visual-level filters when interacting with other visuals
Solved: Hi all, I want to have an interaction between visuals set to "highlight". I have 2 visuals, and each of those 2...
Read more >Real world mutation testing
The scm mutation coverage goal analyses only classes that match the filters and the source file has a given status within the project...
Read more >Configuration Options
Setting this option to false will disable this behaviour. This option is ignored when using the output.preserveModules option as here, imports will never...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have opened a PR with a probable fix for this, but it made us that it may need a bit of redesign to ensure correct results.
Hi @psfinaki
2 Mutants were ignored so they are not taken into account for the mutation score calculation. So your score is 4/6 not 4/8. I can see how this is confusing seeing the number 6 (total tested mutants) is not mentioned anywhere. Now it should have been 100% (4/4) but it seems like the nocoverage filter is applied later than the diff filter which overwrites the ignored value. This is a bug.