Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Your company spends a large budget on browser test infrastructure across many products, and quality incidents still reach production. As the senior technical leader, how do you set strategy for UI testing investment?

We start from where escaped defects actually come from, because UI end-to-end tests catch integration and user-flow problems but cost far more per defect found than lower-level tests. Then we rebalance: more unit, component and contract tests, a thin layer of end-to-end journeys on business-critical flows, infrastructure chosen build or buy on total cost and needed coverage with portable tests, and production signals such as synthetic monitoring, feature flags with gradual rollout and error tracking, which catch what no test can. Finally we set measurable goals, escape rate, lead time, flake rate and cost per pipeline, and review them every year.

Background to this question

Spending more on browser infrastructure while incidents keep reaching production is a sign that the money is buying the wrong kind of safety. A senior technical leader is expected to step back from tools and ask what each layer of testing catches, what it costs, and where the incidents are actually slipping through. In this answer, we will look at how to analyse escaped defects, why the test portfolio should be rebalanced, how to make the infrastructure decision, why production signals are part of quality, and how to set goals that tell us whether the strategy is working.

1Start With the Escaped Defects

An escaped defect is a bug that reached production. Before deciding any budget, we take the last six to twelve months of incidents and production bugs and ask two questions about each one: what kind of failure was it, and which test, if any, should have caught it. Typical categories are logic errors in one service, broken contracts between services, configuration and deployment mistakes, data problems, performance under load, and real user-interface flow problems.

This review usually surprises people. Often only a small share of incidents are the kind a browser test would have caught. Many come from contracts between services, from configuration, or from conditions that only exist in production: real data, real traffic, a third-party outage. If that is the picture, adding more browser tests cannot fix it, however much we spend.

Example analysis of a year of escaped defects
CategoryShareLayer that should catch it
Logic error in one service30%Unit and component tests
Broken API contract between services20%Contract tests
Configuration or deployment20%Pipeline checks, gradual rollout
Production-only data or load15%Monitoring, synthetic checks, load tests
User flow broken in the UI15%End-to-end UI journeys
Illustrative numbers; the point is that each category has a cheapest layer.

2What Each Layer Costs and Catches

UI end-to-end tests are valuable: they are the only tests that exercise the real browser, the real front end and the real back end together, so they catch integration and user-flow problems. But each one is slow, needs a full environment, and fails for more reasons than the code under test. Measured as cost per defect found, they are the most expensive tests we have.

Unit tests check one piece of logic in milliseconds. Component tests check one service or one UI component with its dependencies replaced. Contract tests check that a service still honours the API its consumers rely on, without deploying both. These layers are faster, cheaper and more precise, because a failure points at a specific piece of code. So the rebalanced portfolio has many of those, and a thin layer of end-to-end journeys on top, limited to business-critical flows such as sign-up, checkout and payment.

3Deciding Build or Buy for Infrastructure

With a thinner UI layer, the infrastructure question becomes smaller and clearer. We decide between self-hosted grids and cloud vendors on total cost, including the people who run them, and on the coverage we need: which browsers and versions, whether real mobile devices are required, and which regions the tests must run from. A mix is often right, self-hosted for high-volume Chromium runs and a vendor for Safari and devices.

Whatever we choose, tests must stay portable between providers: the grid address and capabilities come from configuration, not code. Portability keeps negotiations honest and lets us change providers without rewriting tests.

4Adding Production Signals

No test suite can reproduce production exactly, so a quality strategy includes ways to catch problems after release, fast and with small blast radius. Synthetic monitoring runs a few scripted journeys, often the same critical flows, against production every few minutes and alerts when one fails. Feature flags with gradual rollout release a change to one percent of users, then ten, then everyone, watching error rates at each step, so a defect hits a few users instead of all of them. Error tracking collects front-end and back-end exceptions with context, so a new error spike is noticed in minutes.

These are cheap compared with browser grids, and they catch exactly the production-only categories that the defect review showed tests miss.

Step throughWhere a change is checked on its way to users
  1. Unit, component and contract testson every commit, minutes
  2. Thin UI journey suitecritical flows, before merge or deploy
  3. Gradual rollout behind a flag1% -> 10% -> 100%, error rates watched
  4. Synthetic monitoring and error trackingcontinuous, in production
  5. Incident reviewwhich layer should have caught it?

5 steps in order. Play them, or step through them one at a time.

Each layer catches what is cheapest to catch there; the review feeds back into the plan.

5Setting Goals and Reviewing Them

A strategy needs numbers so we can tell whether it works. Escape rate counts production defects per release or per month, ideally weighted by severity. Lead time measures how long a change takes from commit to production, which a slow, flaky suite increases. Flake rate measures how often tests fail without a real defect. Cost per pipeline divides the testing infrastructure cost by the number of pipeline runs.

We set targets, for example halving the escape rate of high-severity incidents in a year while cutting cost per pipeline by a third, and review them at least yearly, with a lighter quarterly check. Each review repeats the escaped-defect analysis, so investment keeps following where the problems are.

6Follow-up questions

What would you cut first?

I would cut UI tests that duplicate coverage available at a cheaper layer, especially tests that check business rules, validation messages or calculations through the browser, and tests that have been flaky for a long time without ever catching a real defect. Before deleting, I make sure the behaviour is covered by an API or component test. I would also cut browser matrix runs on every commit, keeping one browser per commit and the full matrix nightly. Those cuts usually reduce infrastructure spend substantially without losing protection, and the money can fund contract tests and production monitoring where the defect analysis shows gaps.

How do you convince teams that fewer UI tests is safer?

With their own data. When the escaped-defect review shows that most incidents were in categories the UI suite cannot catch, and that the suite's failures are mostly flakes, the argument becomes about evidence. Starting with a pilot team that adds contract tests and gradual rollout and shows a lower escape rate helps.

Is synthetic monitoring a replacement for testing?

No. It finds problems after they reach production, which is later and more costly than finding them before. It complements tests by catching production-only issues quickly, and it limits damage together with gradual rollout.

7Conclusion

In this answer, we set UI testing strategy by first analysing where escaped defects come from, then rebalancing toward unit, component and contract tests with a thin end-to-end layer on critical journeys, deciding build or buy for infrastructure on total cost and coverage with portable tests, adding production signals such as synthetic monitoring, gradual rollout and error tracking, and setting measurable goals for escape rate, lead time, flake rate and cost per pipeline that we review yearly.

What to say in the interviewAbout 100 seconds aloud

Open with

I would start by looking at where escaped defects actually come from. I would take a year of incidents and production bugs and, for each one, ask what kind of failure it was and which layer should have caught it.

Then, if they want more

In my experience only a part of them are user-flow problems that a browser test would find; many are broken contracts between services, configuration and deployment mistakes, or production-only data and load. UI end-to-end tests are the only ones that exercise the full stack, but they are the most expensive per defect found and the flakiest.

So I would rebalance the portfolio: strong unit and component tests, contract tests between services, and a thin layer of end-to-end UI journeys covering business-critical flows like sign-up, checkout and payment.

For infrastructure, I would decide build versus buy on total cost, including people, and on coverage such as Safari and real devices, and keep tests portable between providers through configuration.

Then I would invest in production signals, because some problems only exist in production: synthetic monitoring of critical journeys, feature flags with gradual rollout so a defect reaches one percent of users first, and error tracking.

Finally I would set measurable goals, escape rate weighted by severity, lead time, flake rate and cost per pipeline, and review them yearly with the same defect analysis. The first things I would cut are UI tests that duplicate cheaper coverage and long-flaky tests that never caught a real bug.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your company spends a large budget on browser test infrastructure across many products...": https://scrivio-interview-library.netlify.app/java/ui-testing/f8949c3251/