Behaviour Driven Development
There is a post on the live journal website that does an excellent job of discussing the proper way of understanding test-driven development.
“Test”, in Test Driven Development, encapsulates the idea of specification, design, verification of implementation and the ability to confidently refactor. Regression testing itself is almost a by-product of these uses of the word “test”.
In my experience, this can be the hardest part thing to get people to understand. On the other hand, one person in the comments states that the problem is really a lack of understanding of OOP. I find myself agreeing with this. On the other hand, should TDD not be paradigm independent? Should it not work for both OOP and procedural programming? Or is it tied directly to the Object-Oriented world?
I really like the idea of exchanging the word “test” for the word “should” for the name of your tests.
Don’t test; think “What should this class do? What are its roles and responsibilities? What does it do to the things I’m going to give to it?” Then write a method which will describe the class’s behaviour.