06 January 2008

beautiful TDD post

i came across a wonderful statement of what TDD really means. this post points specifically to typemock, which to me is exactly the type of tool i would not recommend for new development. i believe tools like this, while possibly offering a testing foothold into a system reminiscent of Rube Goldberg's vomit, encourage practices that, as the poster put it, "lose one of the major benefits of TDD: the feedback it gives on internal design quality."
If you use unit-testing tools that let you side-step poor dependency management in the design, you lose this valuable source of feedback and, when you find that you do need to address these design issues because you have to modify the production code, it will be much harder to do so. The poor structure will have influenced the design of other parts of the system that rely upon it. The programmers responsible for the change will not understand the code as well as those who wrote it (even if they are the same people). It's far easier to nip these design issues in the bud as you discover them than let them remain to affect the design of the rest of the code.
i've played with plenty of mocking software in .net and java. while typemock is probably better than those (as it does not force you to write test code using strings!), it still encourages tests to know too much about implementation, which hinders change.

1 comment:

  1. Modern mock object toolkits for Java do not force you to use strings. Have a look at jMock 2, for example.