What are the fine code coverage statistics

Samuel David 21 Reputation points
2022-12-11T20:59:59.553+00:00

Hi All, I am using fine code coverage to see the code coverage. Can someone help me to understand the below statistics(attached sample coverage result). Is it 100% code coverage done here?

269426-code-coverage.jpg

Thanks, Sam

Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Lex Li (Microsoft) 6,037 Reputation points Microsoft Employee
    2022-12-12T07:49:10.33+00:00

    Those are just plain English. Line coverage (how many lines in your source code are covered by unit test cases) is just 17%, while branch coverage (how many if-else branches are covered in unit test cases) is just 18%.

    While 100% coverage is rather difficult to achieve (you need a lot of refactoring to decouple hard-to-cover items), you usually can go above 50% and even 80% by adding more test cases, which can be good enough.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.