liveBook · Manning

End-to-end testing

As explained in Unit Testing Principles, Practices, and Patterns

An automated test that verifies a complete user-relevant workflow across the system and its integrated components.

End-to-end testing verifies an application from the end user’s point of view, reaching directly into all or almost all of its out-of-process dependencies. It is therefore a broad form of integration testing, rather than an isolated check of one unit. section 2.4 section 2.5

Figure 2.6. End-to-end tests normally include all or almost all out-of-process dependencies in the scope. Integration tests check only one or two such dependencies—those that are easier to set up automatically, such as the database or the file system.

Contrast the dependency scope of end-to-end and ordinary integration tests: the former usually includes nearly every external dependency, while the latter limits scope to one or two. section 2.4

Use end-to-end tests deliberately because they make these trade-offs:

  • Favor protection against regressions because they exercise behavior close to the user experience. section 4.5
  • Provide slow feedback because they include many external dependencies and require more setup and maintenance. section 2.4 section 4.5
  • Remain a minority of the suite, with unit tests forming the majority and integration tests occupying the middle layer. section 4.5
  • Preserve resistance to refactoring better than unit tests because they remain more detached from production-code implementation details. section 4.5

Database, file system, and payment gateway

Suppose an application depends on a database, the file system, and a payment gateway. An integration test might use the database and file system while replacing the payment gateway with a test double. An end-to-end test includes all three dependencies, exercising the workflow from the user-facing end through the integrated system. section 2.4

How Unit Testing Principles, Practices, and Patterns covers it

How deep it goes
Defines end-to-end testing and contrasts its scope and trade-offs with integration and unit tests, without detailing implementation procedures.
Examples
Uses a database, file system, and payment gateway to contrast broad end-to-end scope with narrower integration testing.
What it assumes
Assumes familiarity with unit tests, integration tests, and out-of-process dependencies.
What you can do after
Evaluate regression protection and feedback-speed trade-offs when deciding how many end-to-end tests a suite should contain.
How it connects
Connects end-to-end testing with integration testing, unit testing, the Test Pyramid, and black-box testing.

Also explained in

Compare how 12 books explain end-to-end testing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Unit Testing Principles, Practices, and Patterns. The section links point to the parts of the book it draws on.