Why we test
- To validate that our code does what we think it does.
- To enable us to refactor existing code with confidence.
- To ensure that bugs stay fixed. Always fix a bug by first writing a failing test to reproduce it. The bug indicates that we got it wrong once before, so there is a chance we will get it wrong in the future.