← til

Reproducing a bug in the lowest test level possible

April 25, 2021

Tests are a great way to reproduce bugs. Instead of clicking and fiddling with the app, you end up with a deterministic scenario that reproduces each bug.

But while system tests might be the most useful tests, they are also the most expensive. That’s why reproducing a bug in a system test does not make sense. Instead, try to reproduce it in the lowest layer possible. Start with a unit test and work your way up the levels.

Each level adds more context to the bug, and it ends with system tests. If you can’t reproduce it in system tests, you have a bigger problem: a non-deterministic bug.