This article talks about how Test-Driven Development (TDD) isn't really about testing; it's about design.
The goal of TDD is to design the structure of the code before you start programing. Getting better test coverage is really just a side-effect of that. Writing the tests is more of a design activity than a testing activity. It helps you create code that is easier to work with, because you are constantly thinking about how to test your code. And of course, testable code often has other very desirable properties like loose coupling and modular components.
This new perspective on TDD makes a lot more sense to me. It makes more sense to me that TDD is about design, and up-front thinking about code, instead of following rules on how and when you write your tests and code.
No comments:
Post a Comment