Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Further adventures with testing

by jplindstrom (Monsignor)
on Sep 26, 2002 at 18:26 UTC ( #200985=note: print w/replies, xml ) Need Help??

in reply to Further adventures with testing

Further, I've discovered that code that is hard to test is likely to be poorly designed.

This is my experience as well. Not only that, when you prepare for testing, you improve the code. You refactor the code into something better at the easiest time: _when_coding_ it in the first place, when you have everything 100% fresh in your mind.

So, to reiterate (once again) why it's a good thing(tm):

  • Better code structure
  • Less bugs (because you test boundary conditions and challenge assumptions)
  • Confidence

Personally I sometimes find it _easier_ to write-tests-as-you-go, because the code is actually run a little at a time as it grows (as opposed to when the module is finished and in the complex context of the entire program).


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://200985]
[marto]: good morning all

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-10-24 10:00 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (286 votes). Check out past polls.