70 questions / 10 random questions
Random questions, instant feedback, and review for missed questions.
What should be done first when creating a quality plan for a new service?
Answer: Identify and prioritize user, business, and technical quality risks
Quality work should be allocated according to risks, including impact and likelihood. Quality goals, scope, techniques, environments, and exit criteria follow from those priorities.
Why are unit, integration, system, and acceptance testing separated?
Answer: To vary scope and purpose and catch different failures from components to business value
Each test level has a different target and purpose. Unit tests cover components, integration tests interfaces, system tests end-to-end behavior, and acceptance tests business and user needs.
Which test suite best follows the test pyramid?
Answer: Many fast unit tests, with integration and E2E focused on critical paths
A broad base of fast, diagnostic lower-level tests plus a focused set of slower integration and end-to-end tests balances speed, confidence, and maintainability.
An input accepts ages from 18 through 65. Which set represents equivalence partitions?
Answer: 17 or below, 18 through 65, and 66 or above
Equivalence partitioning divides inputs into valid and invalid classes expected to behave similarly, then samples each class. Boundary value analysis complements it at the edges.
A quantity field accepts 1 through 99. Which values best apply boundary value analysis?
Answer: 0, 1, 2, 98, 99, and 100
Boundary value analysis targets values just below, on, and just above each boundary, efficiently revealing comparison and off-by-one errors.
A discount rate depends on membership type, purchase amount, and coupon presence. Which technique is most suitable?
Answer: Decision table testing
A decision table maps combinations of conditions to outcomes, making missing, contradictory, and untested rules visible.
An order moves among received, paid, shipped, and canceled states, with different allowed actions in each state. Which technique fits best?
Answer: State transition testing
State transition testing checks current state, events, next state, and valid or invalid actions, including defects that occur only after specific sequences.
There are too many combinations of OS, browser, language, and role. Which technique covers interactions with fewer cases?
Answer: Use pairwise testing to cover every pair of factor values
Pairwise testing greatly reduces the suite while covering each pair of factor values at least once. High-risk combinations should still be added explicitly.
Which approach makes exploratory testing effective?
Answer: Set a charter and timebox, combine learning and execution, and keep evidence
Exploratory testing is not aimless clicking. A charter, timebox, observations, findings, and remaining coverage make the work focused and explainable.
Which information is most important when prioritizing risk-based testing?
Answer: Likelihood of failure and impact on users and the business
Risk is commonly assessed from likelihood and impact. Change size, complexity, defect history, usage, financial, safety, and regulatory consequences inform priority.
What is the main benefit of traceability from requirements through test results?
Answer: It shows verification status per requirement and change impact
Linking requirements, design, test conditions, cases, results, and defects exposes untested needs, supports regression selection, and provides release evidence.
Which characteristic describes good acceptance criteria?
Answer: Describe conditions, actions, and observable outcomes specifically
Acceptance criteria create shared understanding and a test oracle. They should define observable behavior with examples or measures rather than vague adjectives.
A requirement review finds the phrase 'respond promptly.' What is the best action?
Answer: Clarify the operation, load, measurement interval, and acceptable response time
Ambiguous non-functional requirements become testable by defining the subject, conditions, metric, and threshold. Finding ambiguity in static review reduces rework.
Which information is most useful when reporting a hard-to-reproduce defect?
Answer: Environment, build, preconditions, steps, expected and actual results, and logs
When reproducibility is low, execution context and evidence are critical. Timestamps and correlation IDs connect the report to distributed logs and traces.
Which statement correctly distinguishes defect severity from priority?
Answer: Severity reflects impact, while priority reflects urgency including business context
Severity describes failure impact; priority guides when to fix it. Release timing, workarounds, frequency, contracts, and business needs can make them differ.
The same class of production defect keeps recurring. Which quality assurance response is effective?
Answer: Analyze causes and escape points and feed them into reviews and automated checks
Quality assurance goes beyond finding and fixing individual defects. It improves the process by asking why the defect was introduced and why earlier controls failed to detect it.
What is the best way to select regression tests after a change?
Answer: Select impacted and critical paths from dependencies, journeys, and defect history
Regression scope should consider contracts, shared data, configuration, and downstream consumers, not just changed lines. Fast broad automation can complement focused impact-based selection.
Immediately after deployment, the team needs a quick check that critical functions work at a basic level. Which test fits?
Answer: A smoke test of key functions
Smoke testing quickly checks critical paths to determine whether a build or deployment is stable enough for deeper testing.
Which is the most reliable test oracle for determining expected results?
Answer: An expected result derived independently from requirements, rules, and standards
Expected results should be independent of the implementation to avoid copying the same misunderstanding into the test. Complex behavior may use reference implementations, known examples, or properties.
Production-like personal data is needed in a test environment. What is the best approach?
Answer: Limit purpose, use synthetic or irreversibly anonymized data, and control access
Test data still requires minimization, purpose limitation, access control, retention, and deletion. Prefer synthetic data preserving structure and distributions; justify any real-data use.
Which approach reduces defects missed because test and production environments differ?
Answer: Version the configuration as code and expose differences to reproduce production
Versioned environment definitions make OS, runtime, dependency, configuration, and service-contract differences visible and reproducible without copying production secrets.
What is the best first response to a test that fails intermittently in CI?
Answer: Capture logs and seeds on failure and isolate shared state and async waits
Flaky tests erode trust and hide real regressions. Preserve evidence, reproduce the condition, and make tests deterministic through state-based waits, injected time, and isolated data.
Integration tests make one another fail when run in parallel. Which approach improves isolation?
Answer: Give each test unique data and namespaces with cleanup
Tests should not depend on order or leftover state. Unique IDs, transactions, dedicated schemas, or disposable containers provide isolation depending on the target.
Why are unit tests with a mocked external payment API insufficient by themselves?
Answer: They pass an assumed contract but miss real schema and state differences
Mocks quickly test local behavior but can faithfully reproduce a wrong assumption. Contract tests, sandbox integration, and a small number of end-to-end tests cover the real boundary.
What is the main purpose of consumer-driven contract testing?
Answer: Capture consumer expectations as contracts and verify provider changes
Consumers publish the request and response expectations they rely on, and providers verify them in CI. The goal is early compatibility feedback for real usage.
Which locator strategy makes UI automation more maintainable?
Answer: Prefer roles and labels, with stable data attributes when needed
Locators based on user-facing semantics also exercise accessibility and resist structural changes. Stable data attributes are useful when semantic identification is insufficient.
What problem comes from frequent fixed five-second sleeps in async UI tests, and what is the better approach?
Answer: Too short fails and too long is slow, so wait conditionally for the needed state
Fixed waits are sensitive to environment speed and create both delay and flakiness. Waiting for observable completion with a bounded timeout is faster and more deterministic.
How does property-based testing complement example-based tests?
Answer: It checks invariants over many inputs and shrinks to a minimal counterexample
Generated cases explore boundaries and combinations people may not enumerate, while properties express invariants such as round trips, ordering, and ranges. Important examples remain useful.
What does mutation testing reveal?
Answer: Whether tests detect small injected changes in the source
If a test suite survives an intentionally changed operator or condition, it may execute the code without asserting behavior effectively. Equivalent mutants require interpretation.
Why does 100 percent code coverage not prove the absence of defects?
Answer: It shows execution but not assertion quality or missing requirements
Coverage is a useful indicator of unexecuted code. Weak assertions can execute every line, and behavior missing from both requirements and code cannot appear in coverage.
Which test checks whether response time and throughput meet targets at expected peak traffic?
Answer: A load test at expected peak
Load testing verifies performance objectives under expected normal and peak demand. Stress testing pushes beyond capacity to study degradation, failure, and recovery.
Average response time looks good, but a minority of users experience extreme delays. Which metric should be examined?
Answer: Percentiles such as p95 and p99 and their distributions by load
Averages can hide tail latency and distribution shape. Percentiles, histograms, error rate, and throughput should be correlated over time and load levels.
Which practice appropriately shifts security testing left?
Answer: Add threat analysis, secure code review, and SAST early in CI
Early controls reduce remediation cost, but no single tool is sufficient. Design, code, dependencies, and runtime behavior require complementary techniques and safe secret injection.
Which combination is most appropriate for accessibility testing?
Answer: Check keyboard use, focus order, and contrast with automated and manual tests
Automation efficiently catches machine-detectable issues, but focus behavior, meaningful names, and screen-reader experience require manual evaluation.
Which observation approach is effective in usability testing?
Answer: Give representative users realistic tasks and observe without leading
Observe representative users performing realistic goals and collect completion, time, errors, comprehension, and satisfaction. Record interventions separately.
What is most important when testing failure recovery?
Answer: Detection, failover, integrity, and recovery time after fault injection
Recoverability should be tested end to end under realistic faults, including RTO, RPO, in-flight work, duplication or loss, and restoration of normal monitoring.
Which condition is appropriate for a release quality gate?
Answer: Review critical-risk results, open defects, residual risk, and approval
A quality gate uses agreed evidence by risk and an explicit residual-risk decision, not a single count. Exceptions need rationale, owner, mitigation, and expiry.
How should defect removal efficiency be used for improvement?
Answer: Track where defects are found, including escapes, and evaluate trends
Detection-stage trends can indicate whether reviews and tests find defects earlier. Normalize definitions, severity, size, and period, and combine metrics to avoid gaming.
Which use of metrics should be avoided in a quality dashboard?
Answer: Treat the number of executed test cases alone as quality itself
When activity volume becomes the goal, teams can inflate counts with low-value cases. Dashboards should support decisions through user outcomes, risk, detection strength, and stability.
Which approach safely releases a change that has passed pre-release testing?
Answer: Roll out gradually, monitor guardrails, and roll back on anomalies
Pre-release environments cannot reproduce every production data, load, and dependency condition. Canaries and feature flags limit exposure while guardrails compare errors, latency, and business outcomes.
Before a major legacy-system refactor, current undocumented behavior must be preserved. Which test is appropriate?
Answer: Freeze current behavior in characterization tests and review only intentional changes
Characterization tests record what the existing system actually does as a safety net. Even suspicious behavior should change only after product decisions and impact review.
A unit test depending on current time and random values fails intermittently. Which design is appropriate?
Answer: Inject the clock and random generator and control them with fixed values or seeds
Moving nondeterministic inputs behind injectable boundaries makes time edges, expiry, and random branches reproducible. Record seeds with failures.
A test double should provide a lightweight in-memory implementation with state similar to an external service. Which type is appropriate?
Answer: A fake with a lightweight implementation
A fake is a working but simplified implementation not intended for production. A dummy only fills a parameter, a spy records interactions, and a stub returns prepared responses.
What compatibility check is most important when testing a database migration during a rolling deployment?
Answer: Old and new applications can both use the transitional schema
Rolling deployments include a mixed-version window. Test expand-and-contract, lock duration, reruns, partial failure, and old-version behavior with production-like data volume.
An optional field is added to a public API response. Which backward-compatibility test is appropriate?
Answer: Old clients tolerate the unknown field and new clients handle its absence
Client and server versions differ in distributed rollouts. Use a consumer matrix and contract tests for old/new cross-version combinations.
A short performance test passes, but memory and latency degrade after several hours. Which test is appropriate?
Answer: A long soak test at expected load observing heap and GC trends
Soak tests reveal time-dependent degradation such as leaks, pool exhaustion, cache growth, and log accumulation. Evaluate steady state and post-load recovery.
Which performance test verifies whether autoscaling can follow a sudden traffic increase?
Answer: A spike test with rapid load changes measuring scaling delay and recovery
Spike tests measure detection, provisioning, warm-up delay, and stability after scale-in. Stress testing instead explores limits and behavior beyond capacity.
Inventory reservation rarely loses updates. Which concurrency-test method is effective?
Answer: Use barriers to overlap reads and writes deliberately and verify invariants
Race conditions depend on timing. Widen the contention window with synchronization, record seeds, schedules, and transaction IDs, and assert invariants such as nonnegative stock.
A JSON parser should be robust against unexpected inputs. Which fuzz-testing approach is appropriate?
Answer: Mutate inputs automatically, monitor crashes and hangs, and minimize failures
Fuzzing explores boundary defects through many generated or mutated inputs. Use corpora, seeds, timeouts, and sanitizers, then add minimized failures to normal tests.
An image transformation has no easy direct oracle. Which is an appropriate metamorphic test?
Answer: Verify that a 360-degree rotation matches the original within tolerance
Metamorphic testing uses a relation that should hold across transformed inputs even when exact outputs are unknown. Specify tolerances and applicability conditions.
Which acceptance criteria are appropriate for releasing a probabilistic AI classifier?
Answer: Define precision/recall thresholds and confidence intervals on independent data
AI output requires statistical evaluation. Agree on task-relevant metrics, an independent test set, sample size, confidence intervals, subgroup performance, and safety limits.
Which test-impact-analysis approach appropriately shortens a large regression suite?
Answer: Select priority tests from changes and dependencies and audit with the full suite
Impact analysis provides fast risk-based feedback but can miss tests through mapping errors. Evaluate accuracy with full runs, random sampling, and escaped defects.
What is an appropriate process when temporarily quarantining a flaky test?
Answer: Assign an owner and deadline, keep it visible, fix the cause, and restore the gate
Quarantine is a temporary measure to preserve feedback trust, not a substitute for repair. Track flake rate, affected scope, and overdue quarantines.
Static analysis finds tens of thousands of existing warnings, hiding new defects. What is the appropriate improvement?
Answer: Baseline existing findings, reduce by risk, and gate new code against growth
Clean-as-you-code plus risk triage stops new debt while reducing legacy debt manageably. Suppressions need a reason, scope, and expiry.
Which practice improves defect detection in pull-request reviews?
Answer: Keep changes small and review rationale and test evidence with risk-based checklists
Static review detects defects early. Small diffs, clear intent, risk perspectives, independent review, and verifiable test evidence improve effectiveness.
Which analysis of an escaped production defect best supports recurrence prevention?
Answer: Separate introduction, nondetection, and escape and identify control gaps
Defect escape analysis examines both introduction causes and detection controls. Add a regression test and systemic process or design changes that prevent the defect class earlier.
Which investment decision appropriately uses cost-of-quality thinking?
Answer: Allocate prevention and appraisal effort to areas with high failure cost
Cost of quality includes prevention, appraisal, internal failure, and external failure. Optimize investment against business risk and failure cost rather than pursuing defect removal at any cost.
Why does a zero-finding automated accessibility scan not prove WCAG conformance?
Answer: Some criteria cannot be automated and keyboard and cognitive use need human evaluation
Accessibility evaluation combines automated, semi-automated, and manual testing. Assistive-technology and user testing cover issues machines cannot determine.
Which design safely runs synthetic tests in production?
Answer: Use dedicated accounts and identifiable data, bound side effects, and clean up
Synthetic monitoring continuously checks user journeys but creates production side effects. Design dedicated identity, bounded frequency, data labels, cleanup, cost limits, and security review.
Defect repair clusters just before release because quality is treated as only the QA team's responsibility. What is the appropriate improvement?
Answer: Have product, development, operations, and QA share quality risks and done criteria
A whole-team approach builds quality into requirements, design, implementation, and operations. QA contributes testing expertise and risk visibility, while the entire team owns quality decisions and improvement.
A Playwright Test calls expect(locator).toHaveText("Done") without await. How should it prevent the test from ending before the assertion completes?
Answer: Await the asynchronous assertion before ending the test.
toHaveText is asynchronous. Await its result so the test observes completion or failure. Declaring the test callback async alone does not await every Promise it creates.
A test checks only that no error is visible immediately after clicking Save. It passes even when saving fails later. What is a suitable improvement?
Answer: Wait for save completion, then verify saved data and error state.
Absence of an error before completion does not establish success. Wait for an observable completion condition and verify the saved result rather than merely waiting a fixed duration.
Many snapshot tests fail after a UI change. Even under release pressure, what is required before updating baselines?
Answer: Review differences against intended changes before updating baselines.
Updating snapshots approves current output as the new expectation. Review differences to avoid approving missing content or layout regressions; fix unintended changes in the implementation.
A CI test fails initially but passes on automatic retry. What is lost if reporting records only a final pass?
Answer: Initial instability is hidden, delaying diagnosis and trend detection.
A retry can recover a run without fixing its cause. Track first-attempt success separately from retry recovery and preserve evidence from the original failure.
For if (a && b), tests use only (true,true) and (false,false). What remains untested despite covering both decision outcomes?
Answer: Test a=true and b=false to exercise failure due to b.
Both decision outcomes do not ensure every condition is exercised. With short-circuit evaluation, false a skips b, so these tests never evaluate b as false.
Tests cover every pair of OS, browser, and authentication mode, yet one three-way combination fails. What is the right interpretation and response?
Answer: Pair coverage does not guarantee triples; add the relevant combination.
Pairwise coverage covers two-factor interactions, not every triple. Add the failure as a regression case and consider stronger interaction coverage based on risk.
A surviving mutant is shown to produce the same observable behavior as the original for every permitted input. How should it be treated?
Answer: Document it as an equivalent mutant and distinguish it from killable ones.
An equivalent mutant cannot be distinguished by a valid behavioral test. Document and review the equivalence argument; survival alone does not establish equivalence.
Each virtual user waits for a response before sending another request, so offered load falls as the server slows. How should a sustained arrival rate of 100 requests per second be tested?
Answer: Use an arrival-rate model and monitor missed starts and generator capacity.
In a closed model, slower responses delay new iterations. An open arrival-rate model decouples starts from completions, but generator capacity and dropped iterations still require monitoring.
An input accepts at most 12 UTF-8 bytes. Existing tests use only 12 and 13 ASCII characters. Which cases should be added?
Answer: Include multibyte text and verify boundaries by encoded byte length.
UTF-8 length varies by character. Four instances of あ occupy 12 bytes and five occupy 15. Mixed strings can exercise 11, 12, and 13-byte boundaries directly.
A tax-calculation test obtains expected values by calling the same production function it tests. How should it avoid passing when that function has a rounding defect?
Answer: Use independently derived expectations and boundary cases from agreed rules.
Reusing the same implementation shares its defects with the oracle. Derive expectations independently from the agreed rounding rules and review boundary examples.