Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Peter_L_6
Beginner
64 Views

code coverage: what type of coverage is actually done?

I'm using the codecov tool. One question: what kind of coverage is actually computed on block level?

We would like to state that we have 100% branch coverage (C1 in the literature). My question is how codecov handles the situation where an if statement does not have an else clause? E.g.,

if (decision)
{
    SOME CODE STATEMENTS
}

Will the block coverage reported for this block be 100% if we just test the case with decision = true, or is both true and false required for 100% block coverage?

0 Kudos
1 Reply
Kittur_G_Intel
Employee
64 Views

Good question. If it's necessary for codecov to assume that all blocks generated at the source position (like at if statement) are covered when at least one of the blocks is covered, then you can configure that using the -nopartial  option. If you do, then the decision coverage is disabled for the if statement and the coverage adjusted accordingly. This way, you can get the codecov utility to treat partially covered code as covered fully. Hope that helps.

_Kittur

Reply