It turned out to be a pretty long post (and only the second of several more), but I really think if you'll read everything through it will give you some new insights.
So... are you claiming testing doesn't take time?
Well... Of course I'm not. Testing is not free, and you don't HAVE to write automated tests in order to write code that eventually works. But is it really not cost-effective?
When I demonstrate unit-testing or TDD to developers new to the field, I frequently get reactions such as "well, that's nice, but I could have implemented the same code much faster without tests."
This statement might be true, but there are several reasons why I think by testing you actually save time:
- You don't have to start thinking how to verify that your code works (you already did this)
- You are already after the debugging phase
- You ensure having automated tests that can run later on
There's also the concept of improving design and usability of your code by testing it, which may also save you time in future, but that's something I'm going to talk about more in the next posts of this series.
So lets' dig in and elaborate on all of these points.