Thursday, 3 April 2008

Test Driven Development

One of my esteemed college has been talking this week about the importance to train people on the Top 10 Bug Patterns. I thought this was a very interesting idea that we should pursue.

After all it is not that complicated to inject these common defects in a dummy application and let people chase them.

However, this led me to think about what can we do to avoid these bugs in the first place, and then looking at them one at a time, it became clearer that most of them (if not all) can be prevented using Test Driven Development.

I believe that having strong debugging skills in a team is a must but I too believe strongly that there is no better debugging strategy than one that requires from you that you do not let them get into the code base in the first place.

Obviously, TDD does not apply when you are provided a broken application to work with but this is not the normal case, we generally start from scratch.

I would not sacrifice our XUnit testing training in favor of a debugging training... Thanks Didier for the seed!

3 comments:

Anonymous said...

Absolutely I agree that TDD to avoid bugs is much more valuable than fixing bugs. Same with code review of course.

A lot of effort has been put into prevention, but we also can't neglect the fact that some bugs will always slip through the cracks, and we can't rely on an available architect or senior developer to come save the day. The whole team has to be well versed in the science of debugging.

Nice post, I think it's 2 sides to the same coin :)

Anonymous said...
This comment has been removed by a blog administrator.
Sylvain St-Germain said...

I knew you would agree!