test-design-mandates

Five mandatory rules governing test design in a Clean Architecture context — loaded after Gherkin scenarios are written, before any implementation starts.

When to use

Entry contract

Exit contract

Invariants

Why this shape

Tests enter through a use case boundary and assert at the next visible boundary. This rule prevents TBU (Tested But Unwired) defects — code that works in isolation but is never called through the real composition root.

« Grow the application outside-in, letting the tests guide the internal design. » — Freeman, S. & Pryce, N., Growing Object-Oriented Software, Guided by Tests, 2009.

Rule M4 prevents double coverage: two suites asserting the same behaviour drift together on every rule change with zero additional failure-discrimination value.

Allowed customisation

See also