Ah, i think of test-driven design as meaning the same thing as test-driven
development - they're just different names for the same thing.
Test-driven design as a term is a misnomer anyway. You are doing design
bit-by-bit as you go along, but it's not driven by the tests. It can't be
- if we understand 'design' to mean something like 'architecture' or
'design at a level higher than source code', then it's the design which
drives the tests, because the design is what gives you "i need a class
which embodies such-and-such an idea, and exposes operations this-and-that
to its clients". Having design *driven by* tests is an impossibility.
I suppose test-driven development could be done with a big up-front
design. There's nothing contradictory there. Indeed, even with incremental
design, at every stage you have a picture of what the whole system will
look like when it's finished, even if you're only working on one little
bit of it right now. The only difference between that and up-front design
is that with up-front design, you think about it in more detail before you
start, and you give yourself less flexibility to change it once you do.
That's why i don't see a real distinction between them: even with a big
upfront design, not giving yourself flexibility is a mistake, so with that
out of the way, the only difference is how much thinking you do before you
start. That's clearly a continuum, so there can be no hard and fast
distinction between the two kinds of TDD.
I think it depends on the nature of the project. The last non-trivial
piece of code I wrote was a simulation for my Ph.D. research. That
program existed to be changed. The best runs were those that got me
thinking about new questions, causing further changes to the program.
For that, I was at about level 2.9 - a little thinking about design
before I had a failing test, but not much.
I don't think that would work so well for a project with a few hundred
programmers.
I'm not sure there are any methodologies at all that work well for a
project with a few hundred programmers, but that's another story.
My ideal, which I have never achieved, would be to have two sets of unit
tests, one set written by another developer and one set written by the
same person as the code under test.
That would be interesting. A while ago, we were working with some
contractors who were not great programmers, and who were especially
hopeless at writing tests (they'd write them, because they knew we wanted
them, but they would often not really test anything). I wondered about
managing the interaction between our teams by having us write the tests,
and having them write the code to make the tests pass. That would have
forced them to write better code, and given us a lot more confidence in
what they were doing.
tom