2024-08-07 · Software Testing
Snapshot tests create false confidence
When a green snapshot says nothing about the behavior you just changed.
Introduction
Snapshots are excellent for stable output and terrible for UI that churns weekly. We examine three real failures, then rewrite them as intent-revealing assertions that survive refactors.
Field notes
A few patterns we kept seeing while puttering around Software Testing problems:
- The simple version survived every refactor; the clever version didn’t.
- Documentation written during the work aged far better than documentation written after.
- The second time a problem shows up, it is already a pattern — name it.
A checklist you can steal
- The failure is reproducible with one command.
- The fix has a test that fails without it.
- Someone other than the author has run it on their machine.
Closing
Write the short version future-you will actually read. That is the whole trick.