Reproducing a bug in the lowest test level possible
Since we went on a long bike ride yesterday, I’m happy with how I’ve spent the weekend. Getting away from screens is an ideal way to spend free time when most of our work is done on a computer.
My article for this week is a short technical one, about reproducing bugs with tests. I hope you’ll like it.
Reproducing a bug in the lowest test level possible
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.