Test-Drive Your Database
summary
Shows how to write and run real database unit tests using T-SQLT on Microsoft SQL Server with the Chinook sample data set, starting test-first by creating a failing test for albums_for_artist_by_name then implementing the stored procedure until the assertion matches; runs each test inside its own transaction and groups suites by schema; demonstrates faking tables and spying on procedures, a test-data-builder pattern for concise fixtures, and CI automation via SQLCMD plus a TeamCity runner so tests run and the DB is dropped afterwards.
AI-written summary · about
chapters (21)
- 0:00Intro
- 1:11Why test databases
- 2:16Unit testing frameworks
- 5:38Test recommendations
- 6:58Demos
- 8:07Chinook Database
- 10:22Sequel CLR
- 11:52Writing tests
- 13:22Creating a test class
- 14:22Creating a table
- 20:22Creating a new procedure
- 23:22Testing the new procedure
- 24:22Testing the new procedure again
- 25:22Adding an inner join
- 27:22Test Data Builder Pattern
- 29:22Fluent Syntax
- 30:22Copy Paste
- 31:22Create Procedure
- 34:22Run Tests
- 35:22TeamCity fro
- 36:22Three Steps
related talks
27mDatabase Testing with pytest
58mTDD for database related code, how is it possible?
20mExcellent Database Adventure: From Code Errors to Reliable Releases
20mDave & James’ Excellent Database Adventure: From Code Errors to Reliable Releases
01h 07mDev and Test Agility for your Database with Docker
45mDev and Test Agility for your Database with Docker
37mYes, You Can Test SQL
01h 00mDevOps for Your Relational Database Foundations
