Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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).

/J


Comment on Re: Further adventures with testing

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-09-03 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls