Unit Testing Tool for SQL Server

This open-source database unit testing tool should help make test-driven database development easier to manage.

Unit Testing Tool for SQL Server

You have to learn to crawl before you learn to walk...but eventually we all want to run.

My recent series of articles on Test Driven Development with SQL Server was all about helping you learn to crawl.  If TDD was a completely new concept for you, I wanted to take you through the process one step at a time.  Once you understand the concept, though, you will soon find that the manual steps get tedious.  

Having learned to walk, you now want to learn how to run.

Get Running with tSQLt

If you want to apply the TDD concept on a larger scale, you will want a framework that takes care of the tedious parts of the process.

Big thanks to reader B.C. for introducing me to such a framework for testing in SQL Server.  Here's an excerpt from B.C.'s comment (emphasis added):

Is there a reason why you wouldn't want to use a testing framework like tSQLt?

To be completely honest, I had never heard of tSQLt before reading that comment.  I have since looked at the project website and it looks like a great tool for unit testing SQL Server.  I still haven't used the project, but it's got official backing from premier SQL Server toolmaker Redgate (which lends it some major credibility).

Here are some quick links to get started:

If you try it out (or if you're already a user), let me know your experience with it in the comments below.


External references

tSQLt - Database Unit Testing for SQL Server
Database Unit Testing for SQL Server
All Redgate’s Products For SQL Server, .NET, And Oracle
Browse a full list of Redgate’s tools for SQL Server, Oracle, .NET, and MySQL.

Referenced articles

VBA to T-SQL via TDD - No Longer Set
In this series of articles, I go step-by-step explaining how you can re-write VBA functions as SQL Server scalar functions to increase performance without the risk of introducing logic errors during the migration.
VBA to T-SQL via TDD: Step 7
Step 7. Execute the test query in SQL Server to verify it fails

All original code samples by Mike Wolfe are licensed under CC BY 4.0