Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: The Joy of Test

by drewbie (Chaplain)
on Apr 12, 2002 at 14:23 UTC ( [id://158583]=note: print w/replies, xml ) Need Help??


in reply to The Joy of Test

Further, once I find I need to rework the inner magic of my code, I am confident that I can make nice, sweeping changes and still run my tests and know instantly what went wrong. As this is a research project for my work, I've repeatedly been forced to rework things to try new ideas.

Pure bliss :) Tests. Don't leave home without 'em.

You summed up perfectly the reason we need tests! Code changes, bugs are fixed/introduced. Bugs are bad, so we need to know when they spring to life. Tests are a simple way to quickly & easily verify your code works as expected. As we all know, lazyiness & hubris are the virtues esposed by perl programmers. You put in a little time up front to save a lot of time & headache further down the line. I hate repetition, and anything to reduce it is good in my book. Without tests, there is always a chance that you've missed something. I was sucked in by the excellent article on perl.com which should be required reading for newbie testers.

IMHO, there is not a good excuse to NOT write tests. It could probably be argued that not writing them is a bit negligent on the programmer's part (not to start a flame war...). And with the wonderful modules that the ingenius Michael Schwern has given us, tests are so simple. Witness Test::Simple, Test::More, Test::Harness, and most recently Test::Inline (Write tests inline in POD!). Is there really a good reason to not write tests? I definitely realize that some things are hard to test (like web app controllers - I'd love to hear how you test those), but I do think everything deserves at least a simple test or two. Even if it's just use_ok('My::Module::Name');

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2025-05-22 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.