skip to content

Automation Strategy

What earns a place in an automated suite, how a case is designed and run deterministically, and how a suite keeps its credibility. Interviewers probe the cost of ownership.

on this pageshow

explore

questions

195 · 11 sections

Which properties make a test case a good candidate for automation rather than manual running?

level: juniorimportance: must knowfreq 82%
basics
~20 s

A case pays back when it repeats often, the behaviour it checks is stable, its expected result can be judged mechanically, and running it by hand is slow or error-prone. High risk and a defect history raise its value further.

open as a page

Which checks do you deliberately leave manual instead of automating, and why?

level: middleimportance: must knowfreq 66%
basics
~20 s

Checks that run once, that need a person to judge look, wording or feel, that have no dependable expected result, and that drive an interface still being redesigned stay manual. Each of those costs more to automate than it returns.

open as a page

How do you estimate whether an automated case will repay the cost of writing and maintaining it?

level: seniorimportance: should knowfreq 47%
basics
~20 s

Compare authoring plus recurring upkeep and triage against the manual cost per run multiplied by the runs expected before the behaviour changes. The break-even run count, and whether the horizon reaches it, decides. Most estimates omit upkeep.

open as a page

Your team can sustain only a handful of new automated cases per release. How do you decide which behaviours get them?

level: principalimportance: should knowfreq 38%
basics
~20 s

Rank candidates by expected loss avoided per engineer-hour: severity and defect history, run frequency, manual cost, and expected upkeep. Reserve capacity for upkeep of existing cases before funding new ones, and record what stays manual and why.

open as a page

What should a service-interface test assert about a response instead of comparing the whole payload?

level: juniorimportance: must knowfreq 74%
basics
~20 s

Assert the status code, the few fields the case is actually about, and the response shape the contract promises — and on failure paths the error envelope's code. Whole-body equality breaks whenever an unrelated field changes.

open as a page

How should an automated case at a service interface obtain and refresh its access token?

level: middleimportance: must knowfreq 61%
basics
~10 s

Fetch the token programmatically from the token-issuing endpoint at setup using credentials injected from the environment, cache it per test identity, and refresh it before it expires. Never commit a hand-copied token.

open as a page

How do you decide which assertions belong at the service interface rather than through the screen?

level: principalimportance: should knowfreq 44%
basics
~20 s

Place each assertion where its oracle lives: rules whose evidence is a value in a response belong at the service interface, while only what a person can observe needs the screen. Assert each rule at one level.

open as a page

How do you design a case that proves a write request is idempotent when the client replays it?

level: seniorimportance: nice to knowfreq 33%
basics
~20 s

Send the identical request twice with the same caller-supplied idempotency key, then assert the observable state changed once — one record, one downstream effect — reading it back through an authoritative path rather than a cached view.

open as a page

What is a data-driven test, and why does each row need its own case name?

level: juniorimportance: must knowfreq 71%
basics
~20 s

A data-driven test runs one piece of logic over many input rows held in a table or file. Each row should execute as its own named case, so a failure names the offending row instead of the whole test.

open as a page

In a keyword-driven framework, what lives in the keyword table and what stays in code?

level: middleimportance: should knowfreq 52%
basics
~20 s

The table owns which named actions run, in what order, with what data and what expected outcome. Code owns each action's implementation: how it drives the interface, its waiting, its argument checks and its failure message.

open as a page

When a keyword-driven failure names only a row, how do you make it diagnosable?

level: seniorimportance: should knowfreq 41%
basics
~20 s

Rebuild at the keyword boundary what the machine stack no longer says: print the keyword invocation path, the step index, the bound arguments, a subject identifier from the system, expected versus observed, and per-row artefacts.

open as a page

In an automated test, what makes a readiness signal worth waiting on rather than a proxy for it?

level: juniorimportance: must knowfreq 74%
basics
~20 s

Wait on state that exists only once the work has finished: a persisted record, a status field at its final value, a drained queue. A proxy such as elapsed time or a progress indicator can be true before the work is done.

open as a page

How do you choose the poll interval and the timeout for a wait-until-condition helper in a test?

level: middleimportance: must knowfreq 63%
basics
~20 s

Scale the poll interval to the cost of one check: small for a cheap local read, larger than the latency of a network call. Derive the timeout from a measured high percentile of the real wait plus headroom.

open as a page

A suite's wait timeouts were all raised to 90 seconds to stop intermittent failures. What does that hide, and what should the team do instead?

level: seniorimportance: should knowfreq 54%
basics
~20 s

A blanket raise withdraws the claim that the system finishes in a known time. It hides performance regressions, wrong readiness signals and real races alike. Measure each wait's actual duration, set per-operation budgets from the tail, and fix the signal.

open as a page

When is a retry inside an automated test a legitimate model of the system's contract, and when is it masking a race?

level: principalimportance: should knowfreq 44%
basics
~20 s

A retry is legitimate when it mirrors a contract the system really offers — at-least-once delivery, bounded eventual consistency, a published idempotent operation — and the case asserts that guarantee. Otherwise the retry is discarding evidence of a race.

open as a page

When an automated test fails in a pipeline run, what should its failure message and captured artefacts tell you before you re-run it?

level: juniorimportance: must knowfreq 60%
basics
~20 s

A failure should name the case, state expected versus actual in real values, and point at the failing step, with artefacts captured at that moment - logs, a screen or payload capture, the environment - so nobody has to re-run it to learn what happened.

open as a page

How do you quarantine an automated test that fails intermittently on unchanged code without the quarantine becoming permanent?

level: middleimportance: should knowfreq 56%
basics
~20 s

Move it out of the gating lane but keep it running in a non-blocking one, and record the symptom, a named owner, an expiry date and the behaviour now unguarded. Enforce owner, expiry and a size cap in the build.

open as a page

An automated regression suite has doubled in size and upkeep cost - which cases do you delete, and how do you justify it?

level: principalimportance: should knowfreq 44%
basics
~20 s

Treat every case as paying rent in runtime, upkeep edits and triage time, and earning it by covering a risk nothing cheaper covers. Delete duplicates of lower-level checks, change-detector cases and cases guarding removed behaviour - in reviewable batches, with the accepted risk written down.

open as a page

How do you shard a long-running automated suite across parallel workers so that wall-clock time actually drops?

level: seniorimportance: nice to knowfreq 24%
basics
~20 s

Wall clock is set by the slowest shard, so balance shards by each case's measured duration from previous runs rather than by name or count, and make shards genuinely independent - no shared mutable data, fixed identifiers, ports or accounts.

open as a page

In a test that drives the application's screens, which steps belong on the screen and which should be arranged another way?

level: juniorimportance: must knowfreq 70%
basics
~20 s

Drive the screen only for the behaviour the case is about. Everything before that - accounts, records, settings, a starting state - should be arranged through a faster channel, so the case checks one thing and fails for one reason.

open as a page

In a test that drives the application's screens, what should the final assertion check so the case is a real oracle?

level: middleimportance: should knowfreq 57%
basics
~20 s

Assert the outcome a person would notice - the value, message or state the screen now shows - and assert its content, not just that an element exists. A case that cannot fail when the feature is broken is not an oracle.

open as a page

A 340-case screen-driven pack checks every fare-calculation combination through the screens; which of those checks belong at a lower level?

level: seniorimportance: should knowfreq 44%
basics
~20 s

Keep at the screen level only what needs a screen: that the journey wires together and shows the right result. Rule and combination variation belongs where the rule lives, with one screen case proving the path.

open as a page

A shared base class prepares every case in a suite — what does a case pay for setup it never uses?

level: juniorimportance: must knowfreq 62%
basics
~10 s

An unused inherited setup step costs runtime and reliability: it still runs on every execution, so the case is slower and can fail for reasons unrelated to what it checks.

open as a page

In an automated case, why should record provisioning happen in a setup step rather than between the assertions?

level: juniorimportance: must knowfreq 62%
basics
~10 s

Setup that breaks is not a failed check. Keeping provisioning in one step before the assertions lets a run report could-not-build-the-premise separately from the-product-behaved-wrongly — two different problems with two different owners.

open as a page

Should a driver session be created per case, per class, or per parallel test worker, and what does each cost?

level: juniorimportance: must knowfreq 66%
basics
~20 s

Default to a fresh driver session per case: it is the only lifetime that guarantees a clean start. Reuse across a class or a parallel worker only when acquisition is measurably slow; one case can then poison the next.

open as a page

Why should an automated suite select a deployed target by name rather than carrying its address in the case?

level: juniorimportance: must knowfreq 64%
basics
~20 s

A named target is one indirection point the run resolves once, so the same suite can be pointed anywhere. An address written into a case pins that case to one deployment and must be found and edited when it moves.

open as a page

In what order should a test run resolve configuration from defaults, files, process environment and explicit overrides, and why fix that order?

level: middleimportance: must knowfreq 58%
basics
~20 s

Resolve configuration once at startup in one fixed, documented order: built-in defaults, then a checked-in file, then process environment variables, then explicit overrides, each layer replacing the last. A fixed order makes every run's effective settings predictable.

open as a page

Machine-drafted cases triple a regression suite's case count in a week. What has that growth not proven?

level: juniorimportance: must knowfreq 55%
basics
~20 s

Case count measures how much was written, not how much can be detected. Drafted cases usually re-walk journeys existing cases already walk and check outcomes already checked, so the set of failures the suite can catch may not grow.

open as a page

When a suite repairs its own broken locators and still passes, which product defects does that green run hide?

level: juniorimportance: must knowfreq 55%
basics
~20 s

A repair hides every change that broke the original anchor: a control that moved, was relabelled, lost its announced name, or was replaced by a different one. The suite reports the flow works while the interface changed.

open as a page

In a machine-drafted end-to-end case, how do you tell an outcome assertion from one that restates the steps just performed?

level: middleimportance: must knowfreq 62%
basics
~20 s

An outcome assertion checks a fact the system decided or stored on its own. A restating assertion only re-reads what the case supplied or already watched happen. Ask whether it would still pass with the behaviour removed.

open as a page

Which decisions stay with a person when a machine drafts test cases from a running application?

level: middleimportance: must knowfreq 62%
basics
~20 s

Two: what correct behaviour actually is, and which behaviours carry real consequence. A tool drafting from a running system can only describe what it observes, so it will happily record a defect as the expected result.

open as a page

When does delegating a test's pass/fail verdict to a model beat an explicit assertion, and when is it strictly worse?

level: middleimportance: must knowfreq 46%
basics
~20 s

Delegate the verdict only when the acceptable result is a family you cannot enumerate: free-form text, wording shown to a user, perceived quality. Where an exact value or a structural rule exists, an explicit comparison is strictly better.

open as a page

How does an automated case observe an outbound callback that the system sends to a configured destination?

level: juniorimportance: must knowfreq 55%
basics
~20 s

Point the system's configured destination at a receiver the run stands up, then read the recorded request back from it. The receiver must be reachable from where the system runs, not only from the machine running the suite.

open as a page

Which property should an automated test assert on when the effect it checks lands only after the call returns?

level: juniorimportance: must knowfreq 58%
basics
~20 s

Assert on a settled invariant, a property that stays true once the flow has finished, such as a terminal status or a final total. Do not assert on a counter or an intermediate status that is true for only a moment.

open as a page

When a queue redelivers an identical order message, how do you design the case that proves it is applied once?

level: middleimportance: must knowfreq 62%
basics
~20 s

Publish the identical order message twice — same identity, same body — wait for evidence that the second delivery was consumed, then assert a single visible effect: one row appended, one balance movement, one outbound notification.

open as a page

Before asserting that two published events were processed in order, how do you establish the scope in which that order is promised?

level: middleimportance: must knowfreq 58%
basics
~20 s

Order is promised only inside a scope — usually a routing value such as an account or order identifier, or a single producing path. Read the design to find that scope, then confine the assertion to events sharing it.

open as a page

How do you craft and inject a queue message the consumer cannot process for an automated test?

level: middleimportance: must knowfreq 52%
basics
~20 s

Publish the bad message through the same path a real producer uses, give it a payload that fails at exactly one nameable stage, and tag it with a unique identifier so the case can find it wherever it lands.

open as a page

What must an automated case assert after it backgrounds an app mid-form and brings it back?

level: juniorimportance: must knowfreq 62%
basics
~20 s

Assert the specific values a person would lose - the text already typed, the step reached in the flow, the selections made, any running countdown. Checking only that the app reopened proves nothing about restoration.

open as a page

Why do a tap and a long press on the same list row need separate automated cases?

level: juniorimportance: must knowfreq 58%
basics
~20 s

A long press is a distinct input event that opens behaviour a tap never reaches: a context menu, selection mode, a drag handle. A tap case proves only the primary action, so the held gesture needs its own case.

open as a page

Why can't a handheld app's automated suite just target the newest platform version?

level: middleimportance: must knowfreq 58%
basics
~20 s

Handheld users choose when to update, and many devices stop receiving platform updates entirely, so the installed base stays spread across several version lines for years. A suite that runs only on the newest line leaves most real users unverified.

open as a page

A disconnected mobile client queues user actions and delivers them on reconnect - what does an automated case assert at each of the three moments?

level: middleimportance: must knowfreq 62%
basics
~20 s

Assert three times: while disconnected, that the action is locally accepted and marked pending; at reconnect, that delivery starts unprompted; once drained, that the far side holds the work and the device now matches it.

open as a page

Why derive the recipient address in an automated sign-up test from the case and run identifiers?

level: juniorimportance: must knowfreq 52%
basics
~20 s

A derived address is self-describing: built from the case and run identifiers it is unique, so concurrent runs cannot collide, and it names the case and run that sent the email, making a stray email diagnosable on sight.

open as a page

How do you extract a single-use activation link from a captured sign-up email so the extraction survives wording changes?

level: juniorimportance: must knowfreq 56%
basics
~10 s

Match on structure, not on prose. Collect every link target in the message body, keep the one whose address is the activation route, and assert exactly one matched. Never anchor on the surrounding sentence.

open as a page

When many automated cases send email to one shared test mailbox, how does a case find the email it triggered?

level: juniorimportance: must knowfreq 42%
basics
~20 s

Generate a unique value inside the case and get it into the outgoing email — a subject-line tag or a custom header field — then search the shared mailbox for that exact value rather than for any recent message.

open as a page

Which assertion catches every unresolved placeholder in a rendered notification message at once?

level: juniorimportance: must knowfreq 50%
basics
~20 s

One negative assertion over the whole rendered body beats per-field checks: fail if it still contains the message template's delimiters, a bare slot name, or the text an absent value renders as. Then assert the seeded values appear.

open as a page

Why does a correctly sent activation email often arrive after the case checking for it has already failed?

level: juniorimportance: must knowfreq 58%
basics
~20 s

Sending is asynchronous: the product only hands the message to a delivery path that queues and often batches it. Acceptance for delivery is not arrival, so a case that checks immediately reads a mailbox the message has not reached yet.

open as a page