Search This Blog

Tuesday, May 4, 2010

TDD Why Not?

Starting reading a new book "Growing Object-Oriented Software Guided by Tests"

The catch is that few developers enjoy testing their code. In many development groups, writing automated tests is seen as not “real” work compared to adding features, and boring as well. Most people do not do as well as they should at
work they find uninspiring.
Test-Driven Development (TDD) turns this situation on its head. We write our tests before we write the code. Instead of just using testing to verify our work after it’s done, TDD turns testing into a design activity. We use the tests to clarify our ideas about what we want the code to do. As Kent Beck described it to us, “I was finally able to separate logical from physical design. I’d always been told to do that but no one ever explained how.” We find that the effort of writing a test first also gives us rapid feedback about the quality of our design ideas — that making code accessible for testing often drives it towards being cleaner and more modular.

On all the teams I have been on "Tests" have always been a dirty word. Something you do because you are supposed to not something you do because you take pride in it. I hope the book goes into more about how TDD can help your designs. I think most people I work with do take pride in their designs and are always looking to improve in that area. Seeing TDD as a technique to improve designs might be something people could be inspired by. I think it will take more evidence though than just one statement.

No comments:

Post a Comment