InterviewStack.io LogoInterviewStack.io

Test Levels and the Test Pyramid Questions

How unit, integration, component, end-to-end and contract tests fit together and where each provides the most value. Covers the test pyramid and the competing shapes proposed against it (the testing trophy and the honeycomb), multi-layer test architecture, contract testing as the seam between services, choosing the right level to catch a given class of defect cheaply, and what to run per commit versus per release. Includes the cost and confidence trade-offs between fast low-level tests and slower, broader system tests. The scope is which level a test belongs at and why. Deciding how much to invest in testing and where to prioritize under time pressure is covered separately.

EasyTechnical
71 practiced

From an SRE perspective, explain the differences and roles of the following in a CI/CD pipeline: unit tests, integration tests, contract tests, end-to-end tests, and load tests. For each, describe when it should run (on a pull request, nightly, or pre-production), its typical execution time, and the production risk it mitigates. Give one concrete example of a production incident each test type would help prevent, and discuss how choosing the right mix of these tests influences mean time to detect and mean time to repair.

That is every published Test Levels and the Test Pyramid question for Site Reliability Engineer (SRE) so far. Browse the other topics in this category, or practice this one interactively.