The Case for Running Tests with a Dirty Database
The argument against clearing the database between tests ๐
The text discusses the argument against clearing the database between automated tests, highlighting reasons such as speed, correctness, data growth issues, and parallelism advantages. It presents a shift in mindset to run tests with a dirty database, requiring adjustments to test assumptions and offering advantages such as quicker test execution, a more realistic data shape, and the potential for uncovering bugs with realistic data. The text also addresses potential disadvantages such as increased difficulty in debugging and precondition clashes, along with mitigations for these issues. Additionally, it mentions the author's limited but successful experience in implementing this strategy and its potential for wider application.
- Reasons against clearing the database between tests
- Advantages of running tests with a dirty database
- Disadvantages and mitigations of this approach