Before trying to answer the above question, let us quickly touch base on what is the difference between the terms ‘Unit Testing’ and ‘Test Driven Development (TDD)’, or is there a difference at all?
Here’s what it is. Unit Testing simply means that you write unit test cases to exercise minute parts of the codebase. The term ‘Unit Testing’ by itself does not state the chronological order, ie. whether the code comes first and then the unit test case is written, or whether it is the other way round, ie. the test case is written first. The latter is actually a simplistic definition for TDD. That is, write unit test cases first and then write code to satisfy those test cases.
So TDD is actually the next step in the evolution of Unit Testing, in that the test cases are written upfront, before the code is written, thus providing various advantages. The code that comes out of TDD is rock solid, high quality, better designed, easily testable (especially regression testing), and easily maintainable (one of the reasons being that the test cases act as documentation).
So from that perspective, the question whether TDD makes sense or not, ie whether the code should be written first and then the test case or should it be vice-versa, is a no-brainer (IMHO). TDD has come way beyond the hype stage, and writing test cases first definitely makes proven sense, but whether it will be successful or not, depends wholly on the way it is implemented, the acceptance of this within the team, and the management support to make it work. That’s asking for too much, eh? There are several pitfalls that you need to watch out for, in your journey towards TDD. We’ll examine these in a separate post.
Anyway, TDD is not the be-all-end-all of Agile. If you’re able to make it work, great, you’ll see the benefits. But if you’re not, don’t fret, there are other tenets in Agile which can be implemented easily and fetch good results. We’ll examine some of them in the forthcoming posts.


"Online communities, iterative methodologies and software scalability" with Andres Camacho - Vice President of Engineering at Vinfolio 