The Merits of Test Driven Design

An entry about tdd Publication date 3. February 2008 11:27

Sparked by a recent post by Phil Haacked (of ASP.NET MVC fame), a lively debate on the merits of Test-Driven Design - and in particular a publication by Dr. Hakan Erdogmus at the Institute for Information Technology in Ottawa titled On the Effectiveness of Test-first Approach to Programming ensued, as Jacob Proffitt dissected said report in detail over on his blog a few days ago. I highly recommend reading both the paper, Phil and Jacobs posts (as well as the comments posted on them by various people), as there are some interesting points made on both sides of the fence.

One thing I've always felt TDD is a catalyst for, which the paper seems to miss out on, is increasing the quality of code design and better highlighting what code really needs to be written. By writing code that uses an API before writing the API itself, you're led to writing the API from the outside in, thinking more about its exterior design and what really needs to go into it. If you start from the core and work your way outwards, meeting the required public interface is more a hit and miss process which easily leads to a bloated API that does more than it really needs to, exposing functionality or extension points that will never be used.

Whether this (unproven?) benefit is enough to tip the balance in favor of TDD I'm not sure, but as the debate rages on we can all at least agree on one thing - writing unit tests one way or another is better than not testing at all :)

Be the first to rate this post

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

Powered by BlogEngine.NET 1.4.5.0

Welcome!

My name is Fredrik Kalseth, and this is my blog - thanks for visiting! I am fortunate enough to work with what I love for a living, and this blog is essentially the biproduct of that.

I work as a senior consultant for Capgemini, and am also an active participant in the Norwegian .NET community, as an avid attendee but also as a speaker (most recently at NNUG and MSDN Live).

As a developer, I have a wide circle of interest. My primary passion is for agile, test-driven development, with focus on best practices and clean code. That said, I also love to work on the frontend, especially with web development.

On Twitter? My handle is fkalseth. On LinkedIn? I`m there too.

NDC 2010

The conference to attend this summer happens June 16th-18th in Oslo, Norway. Are you going? Be sure to catch my talk on AOP while you're there!

 

Disclaimer

This is a personal blog; any opinions expressed here are my own and do not necessarily reflect those of my employer. All content herein is my own original creation, and as such is protected by copyright law. Unless otherwise stated, all source code posted on this blog is freely usable under the Microsoft Permissive License.

What Readers Talk About

Comment RSS