What people use for unit test of their stored procedures, etc.

Just trying to figure out what others use to check their routines / queries, databases, etc. Are you using new Visual Studio extensions, native code, etc.? I need someone to formulate some unit tests, but not quite sure how I am going to create tests so that we can easily test regression procedures.

+6
sql-server unit-testing sql-server-2008 stored-procedures sql-server-2005
source share
4 answers

You have many options - as you already mentioned, but for true unit testing, you always want to get as close as possible to the actual unit being tested to avoid integration problems with your tests. For database objects, this means using Visual Studio unit test database projects and writing SQL to unit test database objects, or using some third-party SQL testing platform such as DBUnit.

In some cases, you can use Linq-to-SQL to run some data block tests more concisely / easily than SQL can do, but this should be avoided if it is absolutely necessary for true unit testing; Linq-to-SQL (and any other user code) presents integration problems and additional levels, so if you encounter an error, you first need to make sure that it is really an error in your database, and not in your Linq-to- Connection SQL databases, C # code (for example), etc.

+4
source share

We had great success with DbFit

+4
source share

TST T-SQL Test Tool , it works well and is easy to implement.

+2
source share

This is a big question. In 2007, we developed our own library, described here . Last fall, I wrote about lessons learned from more than three years of use .

+2
source share

All Articles