SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Download tSQLt Today and Start Unit Testing

By Press Release,

The latest version of the tSQLt unit testing framework is now available for download. This is a framework designed to help you write unit tests in T-SQL as stored procedures and execute them programmatically to ensure your code runs as expected.

Learning tSQLt

We've got a number of articles at SQLServerCentral to help you, and there are also tutorials and a quick start on the tSQLt site.

However the best way to get started with unit testing is to try and write some tests. I encourage people to write tests when they find issues, not for every line of code you write. Create a test when you have a bug reported.

Use the very simple format of AAA, which means:

  • Assemble - setup your environment
  • Act - call your code
  • Assert - test the results with one of the assertions in tSQLt.

It's not hard, and once you get the hang of it, you'll find that unit tests are quick and easy ways to ensure that bugs that are reported don't reappear.

Add-ons

There are a few addons that make tSQLt more powerful.

Download Today

Writing tests can help improve the quality of your code. Download tSQLt today at tsqlt.org/downloads.

 
Total article views: 1707 | Views in the last 30 days: 2
 
Related Articles
BLOG

Updating tsqlt

I was looking to write a new test with the tsqlt framework recently. I wanted to isolate a stored pr...

ARTICLE

Installing tSQLt

Get started testing your database code with the tSQLt framework.

BLOG

Generating tSQLt tests from a dacpac

Generating tSQLt tests from a dacpac I use SSDT and tSQLt in my work and I am always interested i...

BLOG

Using tSQLt to Find Min/Max Times

I love tSQLt. It’s a good way to write tests that can determine if your code is actually working. Si...

BLOG

tSQLt – SQLCop – Checking Naming Conventions

I’ve been using tSQLt a bit to do some testing and one of the things I’ve tested is standards for......

Tags
tsqlt    
 
Contribute