Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re(4): More tests or dead code?

by Ovid (Cardinal)
on Apr 01, 2004 at 01:52 UTC ( #341482=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More)
in thread Testaholics Anonymous (or how I learned to stop worrying and love Test::More)

You know, one thing that I forgot to mention, but it's vitally important to remember: if you find out you didn't test something, you might want to ask yourself if you have dead code. In your example, do you ever call that code in scalar context? (well, void context would also exercise that condition, but we'll ignore that) If not, you have dead code. If you do call it in scalar context, why are you overloading the return value? If you don't need to, perhaps this is an opportunity to simplify your code and thereby reduce the chances of bugs.


New address of my CGI Course.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://341482]
[karlgoethebier]: jedikaiti: íHola! Don't turn out the stars tonight
[jedikaiti]: Howdy! Is that link SFW?
[karlgoethebier]: jedikaiti: safe for work? it's youtube...
[jedikaiti]: Which could be anything
[karlgoethebier]: karlgoethebier: some say shockwave isn't safe for work. no risk, no fun ;-)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2017-06-27 15:17 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (609 votes). Check out past polls.