Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

code coverage: what type of coverage is actually done?

Peter_L_6
Beginner
269 Views

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
KitturGanesh
Employee
269 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

0 Kudos
Reply