EMZETT.
Login

Test pyramid and end-to-end tests

In short: The test pyramid recommends many fast unit tests, fewer integration tests and few slow end-to-end (E2E) tests.

In more detail: Unit tests check small units and run in milliseconds. Integration tests check interplay (application and database). E2E tests drive the finished application like a person in a browser (with tools such as Playwright or Cypress) and find errors that unit tests miss, but are slower and more fragile.

In Depth

  • Bottom: many unit tests: fast, stable, precise.
  • Middle: integration tests for database, interfaces, server actions.
  • Top: few E2E tests for the most important user journeys (sign in, buy, upload).
  • Anti-pattern “ice cream cone”: almost only E2E tests: slow, unstable.
  • Stable E2E tests: Wait for visible texts and roles, not for fixed delays.
  • Random failures (“flaky”): Do not skip them, look for the cause.

See also: Unit test, Code coverage, Quality assurance and tests