Skip to the page

Test design and strategy · mid

The test pyramid and a regression plan

Many fast unit tests, fewer API tests, and a thin layer of UI tests. A weekly release needs a plan: what runs on every pull request, every night and before release.

The notes

What you must know

  • Layers: many unit tests, service and API tests, contract tests, and few UI end-to-end tests for critical journeys.
  • The inverted pyramid (1,400 UI tests, 40 unit tests) hurts: three hours of run time, flaky failures nobody trusts, heavy upkeep, and bugs found late.
  • Move validation rules and calculations to unit or API tests. Set up data through APIs. Keep UI tests for journeys where the browser matters (login, search, checkout).
  • Do not just delete UI tests. Map each one to the risk it covers, write the cheaper test first, then remove the UI one.
  • Measure suite time, flaky rate, bugs that reach production and time from commit to feedback. Test count and coverage percentage are not the goal.
  • Every pull request: unit, API and contract tests plus a small UI smoke, under 10 to 15 minutes, and it blocks the merge.
  • Nightly: full API and UI regression in parallel on main browsers, with a named owner to triage failures each morning.
  • Before release: smoke on the release build, short exploratory testing, a checklist. Use tags (@smoke, @regression) so each stage picks its set. Test both states of a feature flag.

The red pen

Common traps: mistake → fix

  • Mistake: More UI tests means more safety

    Fix: they are slow and flaky, so bugs are found late.

  • Mistake: Delete the UI tests and the problem is gone

    Fix: the risk they covered is now untested.

  • Mistake: Run everything everywhere

    Fix: a nightly run nobody reads has no value; give it an owner.

Easy to hard

Questions interviewers ask, easy to hard

  1. Draw the test pyramid and say what goes in each layer.
  2. You have 1,400 UI tests and 40 unit tests. What do you do?
  3. Design a regression plan for weekly releases.
  4. Which numbers would you show your manager to prove the suite is healthy?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview