TDD for database related code, how is it possible?
summary
Claims that full TDD on database code is practical and shows live-coded examples using Hibernate + Spring with DBUnit Unitils Liquibase to version schemas, load XML datasets, and run tests against a real DB (or H2 in-memory). Demonstrates patterns: transaction rollback for isolation, “each test is a hero” isolated data setup, and selectively disabling constraints to simplify cases. Builds save/delete/search tests that actually hit the database, runs them green, and reports this workflow reduces human checklist errors and enables safe schema refactoring.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 3:22Why test data
- 7:34Testing DB code techniques
- 15:28Tests on real DB
- 23:19DB schema versioning
- 26:26TDD benefits for DB
- 29:57Code demo
- 53:12Q&A
related talks
46mHow John Started to Like TDD (Instead of Hating It)
56mTDD: seriously, try it!
32mTesting in Software Development Process: TDD And BDD
45mTDD makes you a better everyday developer
38mSetting up data driven tests with Java tools
52mBuilding Operable Software with TDD (but not the way you think)
21mHow TDD and CDD make your apps suck less
53mTDD & DDD from the Ground Up Live Coding
