Tests test your COMMON SENSE.
We want our code to WORK.
We want it to KEEP WORKING.
We want to develop FAST with CONFIDENCE.
Here's how:
Like √4 instead of √2.
Don't use named constants from the model code.
Avoid generating random input.
Use literal strings and fixed values.
It's ugly but safe.
Mock network calls, local file access, your girlfriend, etc.
Follow these principles and testing will suck slightly less.