Using the Same Tests for Two Implementations
A contract test exercises behavior that each interchangeable implementation promises, under consistent inputs and assertions.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Trace two record stores
An in-memory store and a database store can both promise create, read, and missing-record results. Run the same ordinary fixtures through both. See behavioral contracts.
Add implementation-specific tests where needed
A database has concurrency and migration behavior a simple in-memory implementation may not provide. Test these at the actual component boundary.[1]