I've gone through phases with testing:
1. No tests (yolo phase)
2. 100% coverage obsession (spent more time testing than building)
3. Where I am now: strategic testing
My current approach:
- System tests for critical user flows (sign up, checkout, etc.)
- Model tests for complex business logic and validations
- Skip testing simple CRUD and framework behavior
- Integration tests for API endpoints
What does your testing strategy look like?
Comments (3)
Log in to reply to this post.
I'm in the same 'strategic testing' camp. My rule of thumb: if a bug would wake me up at 3 AM, it needs a test.
I've found that writing tests first for bug fixes is the sweet spot. You prove the bug exists, fix it, and prevent regression. No wasted effort.
We use system tests heavily and they've caught so many regressions. Yes, they're slow, but we run them in parallel and it's manageable.