Devel--Cover icon indicating copy to clipboard operation
Devel--Cover copied to clipboard

Incorrect Condition Coverage percentage ?

Open szabgab opened this issue 6 years ago • 2 comments

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?

condition-coverage-of-markua-parser

From this project: https://github.com/szabgab/perl5-markua-parser

szabgab avatar Mar 29 '18 10:03 szabgab

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!

pjcj avatar Jul 08 '18 17:07 pjcj

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

screen shot 2018-07-09 at 9 29 02 am

using cover --report html_basic

screen shot 2018-07-09 at 9 29 11 am

szabgab avatar Jul 09 '18 06:07 szabgab