Choosing the Layer

Push the test as low as it will go. If a rule can be checked on a pure function, test it there: it will be faster, clearer and less brittle than testing it through three layers.

That is also a design signal. If a business rule can only be tested by making an HTTP request, the rule is probably tangled into the view and would be better extracted.

What only end to end can tell you. That the pieces are wired together at all. That the build produces something that runs. That the form actually submits, the redirect actually redirects, and the deployed configuration is not missing a variable.

A handful of those, covering the main paths, is worth having. Fifty of them is a maintenance project.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Practice Test →
← Back