Test automation is one of the best investments a software team can make, until it isn't. Brittle suites that fail for no reason, tests nobody trusts, and maintenance that eats a sprint every month are common outcomes of automating the wrong things. Here's how to aim it well.
Automate what's repetitive, stable and valuable
The best candidates for automation share three traits: they run often, the behaviour they check rarely changes, and a failure would genuinely hurt.
- Regression checks on core journeys. Sign-in, checkout, payroll runs: flows that must never break.
- Business rules and calculations. Unit and API-level tests are fast, precise and cheap to maintain.
- Integration contracts. Verifying that services still agree on their interfaces catches costly failures early.
- Smoke tests after deployment. A quick automated pass that tells you a release is alive.
Keep humans where judgement matters
Some testing is fundamentally about noticing things a script wasn't told to look for.
- Exploratory testing of new features, where the risks aren't known yet.
- Usability and visual quality. Whether something feels right is a human call.
- Rapidly changing screens early in a product's life, where UI tests would be rewritten weekly.
Respect the pyramid
Most of your automated checks should live at the unit and API levels, with a thinner layer of end-to-end UI tests on top. UI tests are valuable but slow and fragile. Use them to confirm critical journeys work end to end, not to verify every rule.
A small suite the team trusts beats a large suite the team ignores.
Signs your automation needs attention
- Failures are routinely re-run "to see if they pass this time".
- The suite takes so long that developers stop running it before merging.
- Nobody can say which business risks the tests actually cover.
- Fixing tests takes longer than fixing the bugs they find.
Make it part of delivery
Automation earns most when it runs on every change inside the CI/CD pipeline and blocks releases that break agreed quality gates. Pair that with test-first habits, where tests are written alongside or before the code, and quality stops being a phase at the end and becomes a property of how the team works.