On Sun, Mar 16, 2008 at 11:26:52PM -0700, SJS wrote:
Some test driven development fan (TDD!) at Pycon writes his *tests* before
writing any code. I haven't gone that far yet.
I've tried that. It's difficult.
It works a lot better with pair-programming.
Or a development environment that forces you to do it. On my last project
we used Aegis. It doesn't force you to write the test first, but does
require the test to be in place before you can check in a single change.
By default, it requires that the test pass when run against your version,
and fail when run against the baseline.
Without a tool enforcing it, nobody seems to have the discipline to keep
doing it. Once all of the tests are in place, there is a lot more freedom
to modify the code, since the test suite is good at finding errors.
I have a suspicion that the TDD model also breaks down in similar
situations to writing documentation in advance. Where it is better is that
the pre-write stage is much shorter.
I half-recomment the extreme programming book. Other than needing to tear
out a handful of sections (and burn them), it's got some good ideas.
There are tasks where pair-programming can help. There are also a lot
where trying to work with another engineer like that would grind
productivity to a complete halt. Gee it's starting to sound like
programming tasks don't all fit nicely in a box, no wonder management hates
software so much.
David
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg