Test Strategy: Unit, Integration and End to End · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Small fast tests, a few big ones

Computing · Software Engineering · ages 20-21
Name ______________________   Date ____________
  1. Which level proves the whole journey, such as click to receipt?

    • End-to-end tests
    • Unit tests
    • Static typing
  2. Which level checks one small piece in isolation, fast?

    • End-to-end tests
    • Integration tests
    • Unit tests
  3. An integration test proves that combined parts work together.

    Circle one:   True   False

  4. Why does a suite of only end-to-end tests slow a team down?

    • The tests are slow and flaky, and failures hide the broken part
    • The tests run too fast to be trusted
    • The tests force developers to write more units
  5. Charging a card through the real payment service fails, but all unit tests pass. Which level should have caught it?

    • Unit tests, with more stand-ins
    • Integration tests, which use the real service
    • End-to-end tests only, nothing else
  6. A totals bug is cheapest to catch at which level?

    • End-to-end, through the browser
    • Integration, through the payment service
    • Unit, on the totals function itself
  7. A team moves every check into end-to-end tests and deletes the rest. Merges now take hours and often fail for no clear reason. What was the mistake?

    • They kept too many fast tests
    • They pushed everything to the slowest, flakiest level
    • They tested the payment service too little
  8. A receipt shows the wrong total only when a discount and a refund combine. Unit tests of each pass. What is missing?

    • An end-to-end test of the whole purchase with both applied
    • More unit tests of the discount alone
    • A faster test runner
LightMySky · lightmysky.comW1-mt_fdAvx1MMFE-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Small fast tests, a few big ones W1-mt_fdAvx1MMFE-s1

  1. End-to-end tests · End-to-end tests drive the assembled system through the full journey.
  2. Unit tests · Unit tests are the small fast ones that check a single piece.
  3. True · Combined parts are exactly what the middle level is responsible for.
  4. The tests are slow and flaky, and failures hide the broken part · Slow flakes on every change block merges and waste debugging time.
  5. Integration tests, which use the real service · Only a test using the real service can catch a combined-parts failure.
  6. Unit, on the totals function itself · Detail like arithmetic belongs at the fastest level that can see it.
  7. They pushed everything to the slowest, flakiest level · Detail belongs at fast levels. The top level should stay few.
  8. An end-to-end test of the whole purchase with both applied · The fault lives in the combination, so a test must drive the full journey.
Worksheet · LightMySky