Ultra-Detailed Devel::Cover Tuts?

jk2addict on 2006-10-05T13:55:38

I've ran across a slide show (OsCon;Geoff) or two and surfed Google, but I'm probably just looking for the wrong thing. Does anyone have any goo ultra-geeky ultra-detailed docs on what condition failures under Devel::Cover you can fix, and ones you can't fix, and how?

Sometimes, my brain just doesn't grok the truth table yet for things like variable assignment and what D::C: really wants.

For example: blib-lib-Handel-Schema-pm--condition.html

I can add defaults to the end of the assignment chain, and get from 67 to 75%. I think that's fine. I'd just like to read somewhere the in depthness of all of the condition possibilities and whether I should bother worrying about them.

I can't say that this branch coverage doesn't stump me either: blib-lib-Handel-Schema-pm.html

The first 50 makes sense...but the second one in the middle of the same sub, when clicked, just points to the first.

Oy. I need a new hobby.


analysis of devel cover output

dagolden on 2006-10-05T16:25:57

For L12, you've got to expand out the assignment mentally into this:

$dsn = $dsn || $$cfg{'HandelDBIDSN'} || $$cfg{'db_dsn'}

The case you are missing is the one where all of those are false/empty. Adding a default (that is true) doesn't help you get to a case where all are false. That kind of assignment shortcut is a typical place that coverage breaks down.

The branch stuff is confusing. Is your Devel::Cover up to date?

Re:analysis of devel cover output

jk2addict on 2006-10-05T16:39:27

I think so. Not sure though. It may also be a case of the cover -delete not happening so I've got a mix of old and new stats.

On the other side, I'm probably trying to hard to cover everything. I think I'll start off by covering each module one at a time, then start looking at stats for the entire test suite after that.