Home > Software design >  Is dotCover coverage accurate even if some tests fail?
Is dotCover coverage accurate even if some tests fail?

Time:05-04

I have some nUnit tests that are currently failing. For some corporate reasons, I don't want to spend any time trying to fix those tests right now. But I am running a dotCover coverage report on these tests, and I want to know whether the "Uncovered" line count is inclusive or exclusive of these failing tests. To put it another way, if all the tests were to pass, would the coverage percentage increase?

These are new projects, so I have no baseline to understand whether the figure has dropped.

Yes, the tests will be fixed in due course, but not today / now.

CodePudding user response:

dotCover's 'Uncovered' line count is inclusive of the failing tests, meaning that if you fixed the tests it should decrease as more 'lines' are now covered by successful tests.

Yes, the coverage percentage would also increase in proportion to the number of lines covered increasing.

Failing tests -> less lines covered -> lower test coverage %
Passing tests -> more lines covered -> higher test coverage %

  • Related