views:

77

answers:

1
+1  Q: 

Data layer testing

Trying to wrap my head around test driven development. Unit testing is already in place and works fine from business layer up to and including web UI. Now I’m trying to solve question how to test data layer and underlined database. In the past, data layer had more code than in business layer and UI, and keeping the layer untested really hurts quality.

Are there any frameworks to set up database and data layer testing? To be specific, I'm looking solutions for .NET Framework and SQL Server, but I also interested for other platforms and databases.

+2  A: 

If you are using Visual Studio Team Edition, then you can use the Database Developer part to create unit tests against your datamodel.

Other than that, just use regular unit tests to call your DAL or stored procedures directly.

Of course, Database testing usually has an additional set up task for getting the data in a state for testing. And another one for cleaning up after all of the processing has occurred.

Chris Lively