http://qs321.pair.com?node_id=304412


in reply to When -w and use strict aren't enough...

without having to write a test suite that exercises every code branch, which isn't always (or even usually) possible.
Quite the contrary. In a well-maintained system, a test suite that tests every code branch is mandatory. And as they say, "you can pay me now, or you can pay me later" with respect to testing.

Your code should be designed so that testing every branch is possible. If you're writing code that's hard to test, you can't test it, and therefore it's quite possible that some bug will show up in the future. Bad code, Bad code, what you gonna do?

Read Test::Tutorial. Learn how to write tests, and you'll gradually start writing code that can always be tested.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: When -w and use strict aren't enough...

Replies are listed 'Best First'.
Re: •Re: When -w and use strict aren't enough...
by dda (Friar) on Nov 04, 2003 at 14:26 UTC
    What tutorial you are talking about? I've not found anything on CPAN except "Here should be extensive documentation on what unit testing is, why it is useful, and how to do it with the Test::Unit collection of modules. Sorry for not implementing this yet." :(
    http://search.cpan.org/~aspiers/Test-Unit-0.24/lib/Test/Unit/Tutorial.pm

    Please post the full URL.

    --dda