|
|
About
Exploring Solution Spaces, Keith Ray's blog on Software development and other topics.
Send comments to:
keithray@mac.com
Archives
2003
2004
2005
2006
2007
2008
Subscribe
RSS Exploring Solution Spaces XML
|
|
|
Test-Driven Database Development
Scott Ambler announces:
My article "Test Driven Database Development" appears in the current issue
of TASSQuarterly magazine. The issue itself is available at
http://www.tassq.org/quarterly/docs/tassq_magazine-0609.pdf. Just like you
can take a TDD-based approach to developing application code, you can do the
same thing with your database schema. I personally think that it's time
that we start adopting quality practices for database development. If you
work in an organization which considers data to be a corporate asset, and/or
you're implementing functionality in your database via stored procedures,
stored functions, or even OO code, then shouldn't you also have a regression
test suite in place?
Quotes:
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.
[/docs]
permanent link
|
|