Skip to content

Is branch coverage from gcov bogus? (was ACTS-518)

Original author Paul Gessinger-Befurt @pagessin

Ok, so we had this discussion a couple of times, but I have some new input: the branch coverage results reported are off.

The report shows branches in plain function calls, sometimes in struct property access. This is because the functions and probably also the property access produce exception handling code, which obviously includes branches. The only way to get 100% branch coverage is to compile without exceptions, which we obviously can't do.

This is a known "won't fix" issue (see https://github.com/gcovr/gcovr/issues/161, but also a bunch of times on StackOverflow). 

In light of this, it seems branch coverage in C++ is not a useful metric, since you cannot feasibly get it to 100% at all. I think reporting this number in % even though 100% can't be reached is sort of misleading. The significant number of branches reported also makes it very difficult to discern "real" branches from "hidden ones", so it's also not really useful on the path to higher coverage.

I would argue we turn off branch coverage for now, or at least stop reporting it, since the number apparently meaningless.

Thoughts?

<~rlangenb> <~msmk> <~hgraslan> <~asalzbur>?

 

Edited by Moritz Kiehn
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information