in reply to Re^2: Testing Question
in thread Testing Question

If foo($thing) is breaking, but the problem is in the part that created $thing

Then this should be caught by the tests for that part. That's kinda my point, by relying on debugging output which you inspect manually you're hiding the complexity of your program and missing out on vital tests. You are obviously smarter than your test suite and you can reason "ok, this is the output I was expecting, because I know of this side-effect which I'm not testing for otherwise". But this grows too complicated really quickly and IMO it'd be much better to write simple tests for everything so there are no untested side-effects. This way you don't risk missing out on an unexpected value.

Obviously we all have our own methodology and I'm not trying to foist my way of thinking on you or tell you that you're wrong. Just trying to explain how I've found things work best for me.


All dogma is stupid.

Replies are listed 'Best First'.
Re^4: Testing Question
by pileofrogs (Priest) on Feb 24, 2006 at 20:21 UTC

    ++

    Good points!

    So, if I can bother to write a 'print' statement, I can bother to write a test, is basically what you're saying. That coupled with the diag() function in Test::More will go a long way...

    I think what I really need to do is use the perl debugger more. If I wrote tests like you say and ran them in the debugger, I'd get everything I wanted.