Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re(4): More tests or dead code?

by Ovid (Cardinal)
on Apr 01, 2004 at 01:52 UTC ( [id://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.

Cheers,
Ovid

New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-23 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found