Aug/094
Six months of Test Driven Development
Until recently I was working for Australian online retailer carsales.com.au. During some of the pair programming sessions we were involved in I was able to sit with and observe some of the more experienced developers using a test driven approach to development. Despite my attempts with some of my personal projects it soon became clear that I was lacking the skill and discipline to truly reap the rewards. So began my journey to gain a better understanding of this approach and how it might benefit my day to day work as a software developer.
It has been an interesting six months and I have seen a steady increase in my commitment to writing tests before writing production code. I have experimented with successful test first approaches with a range of languages including sql, java, groovy and flex. So what is it about this simple technique that has kept me coming back for more?

Motivation
- One of the key advantages I found was the constant feedback I receive. It's like working your way through a book of little puzzles, solving each one is a small victory that motivates you as you move on to the next. At the end of the day when I sit back with a fine glass of scotch I can rest with knowledge that those bite sized puzzles will serve as a living testament of my achievements.
Minimal Overhead
- Once I began to gain confidence using unit and integration tests to drive development I found myself relying less and less on traditional testing techniques. This allowed me to avoid the common overhead of deployment, start up, logging in, clicking menus, entering data and clicking buttons. I spend less time on all those repetitive tasks that only contribute to an early retirement due to carpal tunnel syndrome.
Less Distraction
- Because my focus is limited to a small concrete section of an overall problem my brain is less likely to become overloaded with unimportant information. Because of the relative simplicity of the test driven approach I find it easier to get started on new tasks, pick up where I left off in the morning or even get back into the swing of things after an interruption during the day.
Less Waste
- The reality of writing tests before writing code means that you need to have a very definite idea of what you are expecting before you start writing code. I find that this discourages me from writing tests (and implementing) for features that I don't need or that I do not completely understand. Any thing that encourages me to keep my software simple is a winner in my book.
This is by no means an exhaustive list of what I like about test driven development. I specifically tried to stick to benefits that can be observed immediately without significant investment. I'd love to hear about the experiences others have had with test driven development, good or bad.