Test-First Development Tool for SQL Server 2005?

For several years I have been using the qmTest testing tool, which allows me to do test database development for some Firebird databases. I am writing a test for a new function (table, trigger, stored procedure, etc.) until it works, and then change the database until the test passes. If necessary, I work more on the test until it works again, and then change the database until the test passes. As soon as the test for the function is completed and 100% of the time has passed, I save it in a set of other tests for the database. Before moving on to another test or deployment, I run all the tests as a set to make sure nothing is broken. Tests may be dependent on other tests, and the results are recorded and displayed in the browser.

Nothing new here, I'm sure.

Our store aims to standardize on the MSSQLServer, and I want to use the same procedure to develop our databases. Does anyone know the tools that allow or encourage such development? I believe that Team Team is doing, but we do not own it at the moment and probably will not for some time.

I am not against scripting, but welcome a more graphical environment.

Any suggestions?

+6
sql-server tdd sql-server-2005
source share
4 answers

Team System is probably the best known solution, but you can also try TSQLUnit (SourceForge).

I have not used it myself, but this article does a decent job of implementing it.

+2
source share

Checkout http://www.sqlservercentral.com/articles/Testing/66553/ and http://www.sqlservercentral.com/articles/Database+Design/66845/

This is a pretty crude article on how to do everything in T-SQL.

Have you ever thought about using NHibernate and using TestDriven or the like only for tests?

+1
source share

In projects where I did not have access to the command system for db pro, I used sql scripts in combination with msbuild and the sdc task library for msbuild ( http://www.codeplex.com/sdctasks ). The msbuild script calls the sdc task to run my sql scripts in a specific order (for example, creating db, creating tables, etc.) and on a specific connection string. Scripts always check if an object exists, and first tear it off and build it.

The sql and msbuild scripts that I place in a regular visual studio database project (which does nothing special, so you can use a simple empty project), so everything is controlled by the source code.

with this set of scripts, you can configure a new database for each test run. You can then use the insert scripts to populate it with data and run tests with it.

These scripts are also useful for setting up databases from scratch in different environments (DEV / TST / QUA / ...)

+1
source share

I was able to adequately apply the test development style to SQL Server databases using TSQLUnit . I followed the same thread that you described when writing the unit test sproc, which does not work, and then making the changes necessary to pass the test. Over time, I also created a test suite when a validator was run that did not break anything when making any new changes.

There were some difficult points (including extreme difficulties when writing tests for existing sprocs), but it worked especially for circuit changes. However, I would recommend looking at the TST T-SQL Test Too1 , which unlike TSQLUnit ( I had to roll my own ) has built-in support for statements.

+1
source share

All Articles