Search code examples
testingcode-coverage

What does a high line coverage, but low block coverage indicate?


Using MS Test and the code coverage support I discovered something with 60% line coverage, but only 17% block coverage. How should I interpret this? (I'm a little fuzzy on blocks compared to lines, but kind of get the idea)

Edit: I am not looking for a definition. Basically I am looking for something along the lines of "It means you wrote tests that covered alot of the lines, but didn't cover the conditional logic and interactions well" Is this what this indicates?


Solution

  • Normally, LineCoverage means, that the test is testing a single line of code. BlockCoverage means, that the test is testing a code block, e.g. the block of an if/else-statement, starting with { and ending with }.

    Greetings,