views:

182

answers:

5

About a year ago, I picked up Scott Ambler's Refactoring Databases: Evolutionary Database Design. I was won over to the idea that just as you can develop your code with TDD, you probably should be covering your databases with unit tests (at least) or even writing database tests before you make a change to the schema so you do database work in a TDD style as well.

I really like the idea, and I have been doing this (OK, sometimes I do it) by hand for a while now, just writing regular unit tests that happen to connect to the database and check its structure against a given schema file. But I haven't found any good database change management tool-kits that might help automate this process. Does anyone know any?

+4  A: 

I only know of two unit testing frameworks:

As for change management, these are some recommended tools:

Although I am not sure if this is really what you're looking for.

Jon Limjap
A: 

Microsoft's next version of Visual Studio for Database is supposed to have these.

NotDan
+1  A: 

I've tried most of the tools, Jon mentioned, but have mostly settled on writing nUnit tests using SMO and SQL commands. I usually validate the table structure, Stored Procs, views and functions.Being able to show the boss 14 broken test due to a developers datatype change made all the work more than worthwhile.

Bruce Murdock
A: 

UTPLSQL for PL/SQL

Andrew from NZSG
A: 

The tool ounit is to Oracle's PL/SQL what junit is to java. We use it to "harness" our database calls. We can repeat them easily and compare the results before and after changes to the code or underlining data structure.

dacracot