Tests are not only used to drive our application design and our code design, but also drive our research and the debugging of the issues that our application faces.
Whenever we face any kind of error, bug, or crash, our fixing process should start with writing a regression test – a test whose purpose is to reproduce the same exact issue we are facing.
Having a regression test in place will prevent that bug from happening again in the future, even if someone refactors some of the code or replaces the implementation. That's not all a test can do – once we've written a test that reproduces our issue, we will be able to more easily debug the issue and see what's going on in a fully controlled and isolated environment such as a test suite.
As our application crashed trying to load our database, we are going to write a test for it and see what the problem is.
The first step is writing a test that reproduces the same exact steps that the user...