Devel--Cover
Devel--Cover copied to clipboard
Incorrect Condition Coverage percentage ?
In a report I got 4 conditions. I one them was or-or and thus had 4 cases. The other 3 had 3 cases each. The coverage was 2/4 + 1/3 + 3/3 + 3/3, but it seems that the 66.7% of total condition coverage was calculated as: 8/12. I wonder why and I wonder if (2+1+3+3) / ( 4 + 3 + 3 + 3) = 9/13 = 0.69 would not be a better way to calculate that?
From this project: https://github.com/szabgab/perl5-markua-parser
Hello Gabor,
Unfortunately the html_minimal report (the default report which you are using here) is buggy with respect to condition coverage. It tries to provide nice reports with multiple conditions, but that's not easy to do. I want to replace it as the default with the html_basic report but it just needs a little extra work first.
Could you try your example here with the html_basic report by running: cover --report html_basic
and see whether that provides a better report?
Thanks!
The code and the line numbers have changed since then, but here is the output on the current version of the code:
using cover --report html
using cover --report html_basic