What to Automate (and What Not To)
Deciding what to automate means choosing, check by check, which tests a script should run and which should stay with a person. Almost anything can be automated, so the real question is whether automating it pays back. In a web shop, the 40 price and VAT combinations of the cart are re-checked every release, have exact expected totals and rarely change: worth a script. The home page promo banner that marketing redesigns every month is not.
This lesson turns the benefits and risks of test automation into a decision you can defend: a three-part rule for each check, and a return on investment (ROI) calculation that counts the costs teams usually leave out.
Why it matters
Automating the wrong checks costs a product twice: time goes into writing and repairing scripts for checks that rarely run or keep changing, and important checks stay manual because the budget is spent. CTFL v4.0 names both causes among the risks of test automation: using a tool where manual testing is more appropriate, and inaccurate estimates of the effort needed to maintain test scripts.
Testers know which checks are repeated every release, which need judgement and which features are still moving, so the decision is part of the job. With a clear rule and honest numbers you can argue for what to automate first, and protect time for the exploratory testing that no script does.
What is worth automating
A good candidate is a check that a person would otherwise repeat many times, with the same steps and a precise expected result. Typical candidates:
- Regression checks that must pass on every release: sign-in, checkout and the business rules behind them.
- Smoke checks after each deployment, which confirm the build is worth testing at all.
- API and contract checks against a specification: usually faster and more stable than the same check through the UI.
- Data-driven checks: the same steps over many rows of boundary values, currencies, locales, roles or browsers.
- Work no person can do by hand, such as generating load from hundreds of concurrent users.
- Repetitive preparation: creating test data and resetting environments, which saves manual testers time too.
Try it: Regression Scenario Generator Try it: OpenAPI → Test Cases
What not to automate, or not yet
These checks are usually better done by a person. Some of them are "not yet" rather than "never": a feature that settles, or a dependency that gets a stub (a simple stand-in that replaces the real service and returns fixed answers), becomes a candidate later.
- Exploratory testing and the first pass over a new feature, while the expected behaviour is still being discovered. A script checks only what someone anticipated.
- Judgement: whether wording is clear, whether an Arabic screen reads naturally right to left, whether a flow is confusing. Tools can measure parts such as colour contrast; the verdict stays human.
- One-off checks, such as verifying last weekend's data migration: run it once by hand or with a throwaway query.
- Features that change every sprint: a screen under redesign, an A/B experiment, a prototype.
- What the test cannot control: a CAPTCHA, which exists to stop automation, or a real SMS reaching a real phone. Ask for a test configuration or a stub, and check the real thing by hand from time to time.
The rule: frequency, determinism, stability
Ask three questions about every candidate, in this order, and automate only when all three answers are yes.
Frequency: how many times will the check run during its useful life? Multiply releases by data rows, browsers and languages: 40 rows at 26 releases a year is 1,040 executions. A check that runs once does not repay the build and upkeep of an automated test; if it is too large to do by hand, a throwaway query or script is enough.
Determinism: can a script decide pass or fail on its own, and does the same input give the same result on every run? "The total is 115.00 SAR" is a definite expected result; "the page looks good" is not. A result that depends on the clock, random data, a shared account or a live third-party service is not repeatable yet: control the time, let the test create its own data or stub the service, then automate. Martin Fowler's article on non-determinism explains the cost of skipping this: once tests fail for no reason, a team learns to ignore failures.
Stability: will the behaviour, and the interface the check uses, stay the same for the next few months? Business rules change less often than layouts. If not, test it by hand now and keep it on a candidate list.
- Three yes answers make a candidate, not an order: rank candidates by risk, as in risk-based testing.
- Automate at the lowest level that can express the check, for example a price rule through the API rather than the UI. The lesson on the test automation pyramid develops this.
- Then run the numbers: a check whose upkeep per run is close to its manual cost never pays back.
Answer: No
Outcome: Keep it manual: one-offRun it once by hand or with a throwaway query.Answer: Yes
Question 2: Can a script decide pass or fail without human judgement?Determinism: a definite expected resultAnswer: No
Outcome: Keep it manual: needs judgementWording, layout, usability; automate only the measurable parts.Answer: Yes
Question 3: Does the same input give the same result on every run?Determinism: no dependence on the clock, random data or live servicesAnswer: No
Outcome: Make it deterministic firstControl the clock, give the test its own data, stub the service; then ask again.Answer: Yes
Question 4: Will the behaviour and interface stay the same for months?Stability: business rules change less often than layoutsAnswer: No
Outcome: Not yet: test it by handKeep it on the candidate list; revisit when the feature settles.Answer: Yes
Question 5: Does it pay back before the check is retired?Honest ROI: build and upkeep against manual runs that would really happenAnswer: No
Outcome: Keep it manual: no paybackUpkeep per run is close to the manual run, or the screen changes first.Answer: Yes
Outcome: Automate itAt the lowest level that can express it, in order of risk.
A "no" today can become a "yes" later: ask again when the feature settles or the test environment gains a stub.
Automation ROI, calculated honestly
ROI compares what automation saves with what it costs over the same period. For a regression check the measurable saving is the manual execution time no longer spent; the cost is everything the automated check consumes, not only writing it.
- Count only manual runs that would really happen. If regression is run by hand once per release, that is the baseline, even if the script will run on every commit.
- Report the other benefits in their own units: feedback within minutes of a commit, consistent results, testers freed for exploratory work. Do not convert them into invented hours.
- Include upkeep from day one: every product change that touches the check, every failed run someone must read, every flaky test someone must fix.
- Compare break-even with the check's expected life: if the screen will be redesigned in four months, a six-month break-even never arrives.
- State your assumptions, and replace the estimates with actual hours after a few months.
Period: one year. Run: one regression cycle, for example one release.
Manual cost = manual hours per run x runs a person would really do
Automation cost = build hours (write, review, test data, setup)
+ upkeep hours per run x runs
upkeep = fixes after product changes, reading failed runs,
fixing flaky tests, CI time and licences in hours
ROI = (manual cost - automation cost) / automation cost
Break-even = build hours / (manual hours per run - upkeep hours per run)
no break-even when upkeep per run >= manual hours per runWorked example: three checks from a web shop
A web shop releases every two weeks and runs its manual regression list before each release: 26 runs a year. The team estimates three candidates; upkeep includes maintenance and reading failed runs.
- A passes all three questions: automate it through the API. It will also run on every commit; that faster feedback is real, but it is not part of the 52 hours. From year two, with no build cost, it saves 39 hours a year.
- B fails stability, and the numbers agree: upkeep per release is four times the manual check. It stays on the manual release checklist.
- C first failed determinism, because the code went to a real phone. The developers added an SMS stub to the test environment, disabled in production, and the check now passes all three questions. A tester still signs in with a real phone after each production release, because the stub cannot prove that real SMS delivery works; that check stays on the manual release checklist and is not part of the 25 hours the script replaces.
Release every 2 weeks: 26 manual regression runs a year
A Cart price and VAT rules, 40 data rows, checked through the API
Manual 2.0 h x 26 = 52 h a year
Automated 16 h build + 0.5 h x 26 = 29 h in year 1
Break-even 16 / (2.0 - 0.5) = 10.7 -> release 11, about 5 months
ROI year 1 (52 - 29) / 29 = 79 %
B Home page promo banner, redesigned every month, checked in the UI
Manual 0.25 h x 26 = 6.5 h a year
Automated 6 h build + 1.0 h x 26 = 32 h in year 1
Break-even none: upkeep 1.0 h per run > manual 0.25 h per run
C Sign-in with an SMS one-time code, using an SMS stub in the test environment;
today checked by hand after each of ~100 staging deploys a year
Manual 0.25 h x 100 = 25 h a year
Automated 10 h build + 0.05 h x 100 = 15 h in year 1
Break-even 10 / (0.25 - 0.05) = 50 -> deploy 50, about 6 months
ROI year 1 (25 - 15) / 15 = 67 %Common mistakes
- Choosing checks by how easy they are to script instead of by frequency, risk and stability.
- Automating a test case that is unclear or wrong: the script repeats the bad check faster.
- Automating a feature that still changes every sprint, then spending every sprint repairing scripts.
- An ROI that counts manual runs nobody would do and leaves out upkeep, failure analysis and infrastructure.
- Keeping a non-deterministic test in the suite and re-running it until it turns green.
- Treating "not automated" as "not tested": manual checks and exploratory sessions still need time in the plan.
The QA perspective
The decision comes up repeatedly: in refinement, when you ask whether a story's rules can be checked through an API with controlled data; when a feature stabilises; and when the regression list is planned. Keep a candidate list with the check, the three answers, the estimated build and upkeep, the risk, the decision and a date to revisit it. Automation engineers estimate the build; the product owner knows how long the feature will stay as it is.
Ask for testability early: a stub, a test hook or a controllable clock often turns a "no" on determinism into a "yes". Each quarter, retire checks that no longer earn their upkeep, and report ROI with actual hours rather than the first estimate.
Practice exercise
Decide which regression checks to automate
A clinic booking web app releases every two weeks, 26 releases a year. Apply the frequency, determinism and stability rule to the four checks below and decide for each: automate, automate after a change, keep manual for now, or keep manual. Then calculate break-even and first-year ROI for the check you would automate first.
1. Booking rules: 30 combinations of doctor, day, time slot and patient type
(no double booking, slots only within opening hours). Checked by hand
through the booking API: 1.5 h per release. Rules unchanged for a year.
Estimate: build 12 h, upkeep 0.25 h per release.
2. Reminder shown in the patient's in-app inbox 24 hours before an appointment.
Today the tester waits for real time to pass or edits the appointment
date in the database.
3. New "family accounts" screen, released next sprint; its design is still
being tested with users.
4. One-off check that 8,000 appointments moved correctly when two branches
merged last weekend.- Answer the three questions for each check and note which one fails.
- For a check that fails determinism, name the change that would fix it.
- Calculate manual cost, automation cost, break-even and first-year ROI for check 1.
- Write the decision for each check and when to revisit it.
Show the model answer
Check 1: frequent (30 combinations at every release), deterministic (each combination has a defined result in the rules) and stable. Automate it through the API. Manual cost 1.5 h × 26 = 39 h; automation cost 12 h + 0.25 h × 26 = 18.5 h. Break-even 12 / (1.5 − 0.25) = 9.6, so at release 10, about five months in. First-year ROI (39 − 18.5) / 18.5 ≈ 111 %; in year two, without the build, it saves 32.5 h. Revisit it each quarter with the actual upkeep hours, or sooner if the booking rules change.
Check 2: frequent and stable, but not deterministic, because it depends on the real clock. Ask for a controllable clock in the test environment, or a way to trigger the reminder job for a chosen time, then automate it. Until then, check it by hand, and revisit when the change is delivered.
Check 3: fails stability; the expected behaviour is still being discovered. Explore it by hand now and revisit once the design is settled after release.
Check 4: fails frequency, because it runs once. Check it by hand, with a throwaway query to compare counts and a sample of records, and do not add it to the regression suite.
Frequently asked questions
Should every regression test be automated?
Every regression check that runs each release, passes the three questions and pays back its build and upkeep is worth automating, in order of risk. Checks that need judgement, change often or cannot be controlled stay on a short manual checklist. There is no correct percentage; the split follows the product.
Do I need exact numbers to calculate ROI?
No. Use estimates, but write down the assumptions: manual minutes per run from your execution records, the build estimate from whoever will write the script, and an upkeep figure that includes reading failed runs. A best and a worst case are more honest than one number. Replace the estimates with actual hours after a few months.
What if a check is important but not deterministic?
Make it deterministic first: control the clock, give the test its own data, stub external services. If that is not possible, keep it manual or automate only the part with a definite result. Do not leave a test that fails at random in the suite that gates a release.
Is a check that runs once per release frequent enough?
It depends on its cost. Twenty-six runs a year pay back a long manual check with low upkeep, such as 40 data rows through an API, but not a five-minute check of a screen whose changes break the script every month. The break-even formula answers it for each case.
References
- ISTQB Certified Tester Foundation Level (CTFL) v4.0The foundation syllabus of software testing: test levels and types, test design techniques, test management and tools.
- Certified Tester Advanced Level Test Automation Engineering (CTAL-TAE) v2.0ISTQB's advanced syllabus on designing, implementing and maintaining test automation solutions and their architecture.
- Eradicating Non-Determinism in Tests (Martin Fowler)Why flaky tests destroy a suite's value, their common causes (isolation, asynchrony, remote services, time, resource leaks) and quarantine as a response.
- The Practical Test Pyramid (Ham Vocke)A widely cited explanation of how to balance unit, integration, contract and UI tests in an automated test portfolio.
Practise with Mutqan tools
Generate regression scenarios from a change description and a list of affected and related modules.
Generate a structured test-case matrix (positive, negative, auth, boundary) from an OpenAPI / Swagger specification.
Score features by likelihood and impact, then generate a prioritised risk-based test plan.
Calculate percentages, percentage change, increase/decrease and what percent X is of Y.
Go deeper
Your progress on this topic
Not started
Mark the topic complete when you have studied it and done the exercise.
Sign in to track your progress
Mark topics complete, continue where you left off and unlock specialisation exams.