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

Re: Further adventures with testing

by jplindstrom (Monsignor)
on Sep 26, 2002 at 18:26 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found