[PATCH] D138847: MC/DC in LLVM Source-Based Code Coverage: llvm-cov visualization
Alan Phipps via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 4 07:40:48 PDT 2023
alanphipps marked an inline comment as done.
alanphipps added a comment.
Hello! Thanks for your question.
In D138847#4636826 <https://reviews.llvm.org/D138847#4636826>, @futogergely wrote:
> Also if you consider branch coverage as well, it will show that the tests missed some spots.
>
> As far as I understood, MC/DC coverage should be more strict than branch coverage, so 100% MC/CD coverage should imply 100% branch coverage. Or do I miss something here?
This implementation of MC/DC is similar to that of other vendors (e.g. LDRA) in that MC/DC coverage for single condition expressions is trivially derivable via branch coverage, which ought to be considered together with the MC/DC metric. A “test vector” for a single condition (boolean expression without operators) is simply true or false. Strictly speaking, branch coverage also gives you a metrics for other things that don’t involve an explicit Boolean expression, such as switch statements and loop ranges. The metric itself need not imply 100% branch coverage.
As this is a good observation, I can make sure the documentation is clear on this point.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138847/new/
https://reviews.llvm.org/D138847
More information about the llvm-commits
mailing list