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

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

by merlyn (Sage)
on Nov 04, 2003 at 13:43 UTC ( #304412=note: print w/replies, xml ) Need Help??

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." :(

    Please post the full URL.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://304412]
[1nickt]: marioroy Yes, I am using it with MCE, as is Discipulus I believe. I was trying to work out how to make a cpanfile that would be smart enough to know which deps to require.
[1nickt]: See this code. (I expected to simply eval loading threads as a check, but weirdness happened with Perlbrew so it's a grep of -V ...)
[choroba]: Config might be better than grepping -V
[Corion]: Also see Config::V, which is less of that hackery, or that hackery hidden in a module ;)
[1nickt]: The problem was with Perlbrew
[Corion]: Whoops - Config::Perl::V
[1nickt]: I found that when using Perlbrew as recommended, with cpanminus in the system perl lib, such tests were failing to detect the data about the perl that was the install destination.

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2017-10-18 15:35 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (249 votes). Check out past polls.