linux-test-project / lcov

LCOV
GNU General Public License v2.0
866 stars 234 forks source link

Differential coverge numbers don't add up #262

Closed Vladyyy closed 5 months ago

Vladyyy commented 5 months ago

See the examples provided below: image

I would expect that UBC + CBC = Total but that is not the case. In the example 243716 != 71615 + 171445 - > 243716 != 243060

Is my UBC + CBC = Total assumption wrong ?

henry2cox commented 5 months ago

Total should be equal to the sum of all the (non-deleted) coverpoints: UBC + CBC + LBC + + GBC + UIC + UNC + GNC +GIC That is: the sum of all the baseline coverpoints which still exist, plus all the new coverpoints created by newly added code as well as those created by changed compiler directives (say).

Vladyyy commented 5 months ago

Thanks, that makes sense.

A follow-up question: Does CBC / (CBC + UBC) * 100 represent the coverage percentage for the baseline

henry2cox commented 5 months ago

The short answer is "not quite":

Of course, some of those categories may be empty - depending on what changed in your code and configuration.

This is discussed (to some degree) in the IEEE paper referred in the README - primarily in the section which talks about coverage criteria. The context of that discussion if how some more sophisticated module-, directory- or file-specifc criteria can be verified and enforced.

Vladyyy commented 5 months ago

Thanks, this was helpful.

his is discussed (to some degree) in the IEEE paper referred in the README - primarily in the section which talks about coverage criteria.

I did read the paper and watched you presentation