Confession: For the first 10 years of my career, I considered automated...
Confession: For the first 10 years of my career, I considered automated testing a waste of time.
Now, after 10 years of writing tests, I realize:
1. It's often worthwhile
2. Watch for diminishing returns
100% test coverage rarely makes sense
0% test coverage rarely makes sense
The hard part: Realizing when more tests are no longer worth the extra cost.
Automated tests are valuable because they're *automated*. Often, automation pays off. But, not everything needs to be automated.
Watch for diminishing returns.
I thought automated testing was a waste of time because:
1. The tools were lousy.
2. The existing code I was working with was lousy.
3. My testing skills were lousy.
This combination meant I was slow and ineffective writing tests.
Today, writing tests makes me *faster*.