SQLBits 2013

Thwarting Database Defects

This demo-packed session introduces you to database unit testing. You’ll learn techniques to write SQL code that is resilient to defects and is easier to change and maintain.
How would you like to spend less time fixing bugs? Come and learn how to use unit-testing effectively in your database code. This fun and demo loaded session will show you how to prevent bugs in your SQL code and make it easier to maintain at the same time.

It’s bad enough to spend hours finding and fixing database defects, explaining to the rest of the team what went wrong and trying to clean up the mess. It’s even worse when a defect causes the end-user to make a bad decision. Database defects are far too costly and most testing practices do not adequately detect or prevent them.

In this session we will cover a variety of patterns for writing test cases and techniques to overcome barriers that are unique to database unit testing.

You’ll learn:
  • How to write your tests using an automated testing framework
  • The basic structure of a test case, including the AAA pattern
  • What tests to create based on test identification patterns, called testing heuristics
  • How and when to create test data that leads to maintainable test cases.
  • What to do with constraints and dependencies. 

By the end you will be able to write your own tests to get you started on the way to robust and easier to maintain T-SQL code.