Folllowing is my coverage statistics:
Coverage: 76% 310 statements 253 run 94 branches 57 missing 13 excluded 27 partial
Can anyone please help with the formula to calculate this %?
Folllowing is my coverage statistics:
Coverage: 76% 310 statements 253 run 94 branches 57 missing 13 excluded 27 partial
Can anyone please help with the formula to calculate this %?
You can't get the exact total from those displayed numbers, because of how branches are counted. But roughly, the total is:
total = (executions)/(possible executions)
The number of executions is the number of statements plus the number of branches, minus the number of excluded statements.
possible executions = statements + branches - excluded
The number of executions is the number of run statements plus the number of taken branches. We don't display the number of taken branches, so you have to estimate:
executions = (run statements) + (total branches - partial branches)
That gives us:
total = (253+94-27)/(310+94-13) = 81.8%