Chapter 25Database Patterns

Patterns in This Chapter

Database Sandbox 650

Stored Procedure Test 654

Table Truncation Teardown 661

Transaction Rollback Teardown 668

Database Sandbox

How do we develop and test software that depends on a database?

We provide a separate test database for each developer or tester.

image

Many applications use a database to store the persistent state of the application. At least some of the tests for such an application will require accessing the database. Unfortunately, a database is a primary cause of Erratic Tests (page 228) due to the fact that data may persist between tests. A major goal in keeping tests from interacting ...

Get xUnit Test Patterns: Refactoring Test Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.