</>

Technology

Scenario-Based

Difficulty

Advanced

Interview Question

How do you prioritize which test cases to automate in a project?

Answer

Prioritizing Test Cases for Automation

Not every test should be automated. Wrong prioritization wastes automation effort on low-ROI tests.

Automation Candidate Matrix

Score each test on these factors (1-5 scale):

CODE
Score = Frequency × Risk × Stability × Data-Driven Potential - Manual Effort
Test TypeAutomate?Reason
Regression suite (run every sprint)✅ YesHigh frequency = high ROI
Smoke tests (run every build)✅ YesCritical, frequent, fast
Data-driven (50 data sets)✅ YesTime-consuming manually
Cross-browser validation✅ YesManual would take days
New feature (unstable locators)⏳ LaterWait for feature to stabilize
One-time migration test❌ NoROI too low
Exploratory testing❌ NoRequires human judgment
CAPTCHA/OTP flows❌ NoCannot automate reliably
Highly visual design tests⏳ MaybeUse visual testing tools
Infrequent edge cases❌ NoManual is faster

Priority 1 — Automate First

CODE
✅ Login / Authentication flows
✅ Core user journey (search → add to cart → checkout)
✅ API endpoint smoke tests
✅ Data entry forms with 20+ test data sets
✅ Cross-browser critical flows
✅ Nightly regression suite
✅ Tests that failed in last 3 releases

Priority 2 — Automate Next

CODE
⏳ Error message validation (forms, boundaries)
⏳ Permission/role-based access tests
⏳ PDF/Email generation triggers
⏳ Search and filter combinations
⏳ Pagination and infinite scroll

Do Not Automate

CODE
❌ Tests for features being redesigned next sprint
❌ Tests that require subjective judgment ("looks correct")
❌ Production data cleanup scripts
❌ One-time setup scripts
❌ Tests with dynamic, unpredictable data

Automation ROI Formula

CODE
ROI = (Time saved per sprint × Number of sprints) / Automation effort

Example:
Test: Login regression — 4 scenarios, 20 min manual each sprint
Automation effort: 4 hours to write

ROI = (80 min/sprint × 20 sprints) / 240 min = 6.6×
→ Good candidate: automate it

Test: Visual layout check — 1 test, 5 min manual
Automation effort: 4 hours + visual tool setup

ROI = (5 min/sprint × 20 sprints) / 240 min = 0.4×
→ Poor ROI: keep manual or use lightweight visual snapshot

Automation Coverage Target

CODE
Smoke tests:     100% automated (run on every commit)
Regression:      80% automated  (run on every PR/daily)
Exploratory:     0%             (always manual)
New features:    Automate after 2nd sprint of stability

Follow AutomateQA

Related Topics