I don't know anyone who thinks that TDD is the be-all-end-all of software
development. The reality is that it does offer some very tangible benefits:

   - Everyone writes some kind of test. It might be a scribble pad that you
   run to make sure something works. It might be that you write code and then
   run the application and try to confirm that the code does what it should.
   Unit testing simply formalizes this and makes it a process that can be
   easily documented and repeated.
   - Writing a test first does help you determine the design of the code
   you're going to write. If you're writing a new block of code or a new
   method, writing the test helps you look at it from an API perspective: What
   do I have to pass in? What do I expect to get back? What can go wrong?
   - In a dynamic language like ColdFusion, unit tests pretty quickly become
   essential. Since we have no compiler, we can't catch any errors until
   runtime. And since values can be nearly any type, without tests that enforce
   input and output requirements it is extremely easy to write code that seems
   to work fine on the surface, or at least doesn't throw an error when you run
   it. It might be much later that something goes wrong. Tests help reduce the
   likelihood of this.
   - When a bug is found, if you add it to the test you make it far more
   unlikely that that bug can reappear.
   - Perhaps most importantly, creating and maintaining a suite of unit
   tests makes ongoing development much, much easier. If you make a change, it
   is incredibly useful to be able to run all of your tests and be fairly
   confident that you didn't break something else. Of course this isn't a
   guarantee, but it is vastly more reassuring than having no tests at all.

Now, should TDD give one complete confidence? Of course not. But it offers a
lot of benefits anyway, and it offers far more confidence than not having
any tests. It is for these reasons (which I would call very pragmatic
reasons) that I would recommend that everyone follow TDD.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312024
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to