Thanks for reminding about that discussion. Based on that video, to me
it seems that Jim doesn't like the de-emphasis that some people put on
architecture and up-front design when teaching TDD.
Also he says that "unit testing was a great idea in Fortran, when you
could build these layers of APIs and the units of organization of the
software were the same as the units of testing, but today the units of
organization of the software are objects and we're testing procedures
and there is a little bit of a mismatch" and "you can't refactor your
way out of this because the refactoring has to be across class
categories, across class hierarchies, and you no longer can have any
assurances about having the same functionality." So appears to have
the point of view that in TDD the unit tests have a direct relation
with the structure of the production classes.
I, on the other hand, try to avoid a direct relation between unit
tests and the code which passes them. Instead I organize my unit tests
around the behaviour of the system [1] (though many times also the
structure of the system is organized around the behaviour, due to
following the Single Responsibility Principle, but even then the
structural relation between the tests and production code is
inadvertent). So I don't agree with Jim's notion of there being a
mismatch. The kind of tests to write is orthogonal to the mechanics of
TDD - skill is needed to write good tests which do not suffer from
fragility when the system under test is refactored or rearchitected.
Jim says that "one of the things we see a lot, in a lot of projects,
is that projects go south on about their 3rd sprint and they crash and
burn because they cannot go any further, because they have cornered
themselves architecturally." I think that is a good thing. TDD is
exposing problems with the design by increasing the pain [2] of
working with a bad design, and ultimately revealing the skill
deficiency [3] of its developers. The right way to react to this
feedback would be to improve the design and the skills of the
developers. So I think TDD works well when the developers create a bad
design and TDD grinds the project to halt - thus preventing the
shipping of crap. :) With a waterfall method the problem would have
been detected much later, maybe after many years when the developers
start demanding a rewrite. [4]
[1]
http://blog.orfjackal.net/2010/02/three-styles-of-naming-tests.html
[2]
http://blog.orfjackal.net/2010/04/direct-and-indirect-effects-of-tdd.html
[3]
http://www.vimeo.com/groups/7657/videos/3756344
[4]
http://www.informit.com/articles/article.aspx?p=1235624&seqNum=3