There are several advantages to TDD:
1. It promotes a significantly higher-level of unit testing [....]
2. It enables you to take small steps when [....] For example,
assume you add some new functional code, compile,
and test it. Chances are pretty good that your tests
will be broken by defects that exist in the new code.
It is much easier to find, and then fix, those defects if
you've written two new lines of code than two
thousand.[...]
3. It promotes detailed design. Bob Martin [5] says it
well ���The act of writing a unit test is more an act of
design than of verification. It is also more an act of
documentation than of verification. The act of
writing a unit test closes a remarkable number of
feedback loops, [...]"
A test-driven database development (TDDD) approach provides the
benefits of TDD, plus a few others which are database related.
First, it enables you to ensure the quality of your data. [...] Second, it enables you to validate the functionality implemented within the database (as stored procedures for example) that in the past you might have
assumed ���just worked���. Third, it enables data professionals to
work in an evolutionary manner, just like application
programmers. [...]
Part of test-driven-development is refactoring, and Scott gives a high level description of a database-refactoring in this article. There is more at www.agiledata.org. He also lists several database testing tools. Interesting magazine - it also has articles by James Bach, Rex Black, Michael Bolton, Duncan Card, Fiona Charles, Cem Kaner, Joe Larizza and Richard Bornet. Check it out.