Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Lessons learned from getting to 100% with Devel::Cover

by hesco (Deacon)
on Oct 28, 2008 at 01:08 UTC ( [id://719879]=note: print w/replies, xml ) Need Help??


in reply to Lessons learned from getting to 100% with Devel::Cover

I'm not bothered in the least by having a 'redundant' path in my code of the form:

if(1) { $obj->method(); } else { print STDERR "False is true, War is peace and slavery is freedom. W +e should never have reached this condition.\n"; die; }
Somewhere among all those Best Practices articles I've read, I picked up the habit of never writing a conditional without an else clause. I can elsif my way through lots of potential logical branches, but if I fail to code some exception throwing into a final else branch of the dispatch code, I will never know if I truly covered all the bases.

I tried this '100%' exercise with a module last year, and got coverage of over 90%, most of the uncovered execution paths were along the lines of the example above.

-- Hugh

if( $lal && $lol ) { $life++; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://719879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found