To Unit Test or not to Unit Test


It seems like some dust has been stirred up around the issue of unit testing and the role that unit tests should play in a developer’s overall TDD strategy. After reading through some writings on ‘con’ side, I’m finding the issue very thought-provoking, specifically in regards to the relationship of unit tests and code design.

Before moving on though, let’s draw a distinction between the general concept of TDD (writing tests to help you define your needs and design your program) and unit testing (testing specifically of models and model methods). These are often lumped together, and many people think of TDD only as unit testing. This is not necessarily the case, and, as I’ll try to feel out, this conflation may be the cause of the current debate.

When I was taught TDD, the emphasis was on using unit tests to help you design your methods — by specifying the method’s…

View original post 1,165 more words