Why Test
Here are some common reasons given for automated testing:
- Reduce bugs
- Confirm nothing breaks when platform and dependencies are updated.
- Provide documentation
- Improve application design
- Expose design flaws; "architectural pushback" (AiA)
- Defer design decisions (Metz)
- Write decoupled code (Martin)
- Support refactoring
- Supports increasing abstractions (Metz)
- Confidence to drastically evolve the app (AiA)
- Clean messy code so you aren't slowed down by it anymore (Martin)
- In all of the above, the ultimate goal is to reduce costs of time and money (Metz)
Sources:
- Adventures in Angular podcast, episode 25: Testing with Ward Bell.
- Uncle Bob Martin, Architecture: The Lost Years (video)
- Sandi Metz, Practical Object-Oriented Design in Ruby, chapter 9.
Slapdash