question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Coverage analysis filter overwrites Ignored mutant statuses while it should ignore them

See original GitHub issue

Describe 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 image

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 image

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 image

Expected behavior There are a few things wrong:

  1. 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).
  2. 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:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dupdobcommented, Jul 3, 2021

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.

1reaction
rouke-broersmacommented, Jun 11, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found