Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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.

Cheers,
Ovid

New address of my CGI Course.


Comment on Re(4): More tests or dead code?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2014-10-30 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls