Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Devel::Cover tells you how much of your code your tests are exercising. So, if you don't hook it into your tests, how is it supposed to do its job?
Personally, I think your layout is borked. There is no reason to put your t/ directory under lib/Foo/Bar, just because the Foo/Bar levels have no files. Put it as a peer to lib/. So, that way, if you put your t/ there, your cover_db will also be a peer to lib/, which is a good idea. (Also, I'm a little curious why you consider your CGI scripts to be documentation in docs/ as opposed to executables in scripts/ or bin/.) Now, the numbers being linked are percentages. In other words, what percentage of the branches/conditions/etc. that this "line" has were exercised? But, you can ignore those for now. Right now, you need to look at the summary page. The important thing here are the boxes which aren't green or white. Those are the ones you need to look at.
Now, when you strive for higher in the branches/conditions/statements, that's when you need the linked-to items. You look at those and where it's red, that tells you what you're not testing. For me, I often test my expected cases, but don't always test my failure cases. So, a lot of the code I have to make sure bad things don't happen never gets tested, which shows up in my coverage. I find that if you test all your happy-day scenarios and the basics of your sad-day scenarios, you'll get to 90%+ very quickly. In reply to Re: Devel::Cover tutorial wanted
by dragonchild
|
|