database sequence
A database object that hands out increasing numbers, typically used to create new row IDs.
In more detail
Sequences are not rolled back with a transaction, so tests that assert exact IDs need the sequence reset or should not depend on the number at all. Reset sequences deliberately in database test fixtures, just like time-dependent data.
Related terms
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
- test isolation — The property that each test sets up everything it needs and leaves nothing behind, so tests pass in any order.
Taught in
- Testing With Real Databases — Automated Testing, TDD & Quality Engineering