practice

Fitness Function

An automated check that an architectural characteristic still holds, run continuously rather than reviewed occasionally.

evolutionary-architecturetestinggovernance

If an architectural rule matters, something should fail when it is broken. A fitness function is that something: a test asserting the domain layer imports nothing from the infrastructure layer, a CI gate that fails when p95 latency in a benchmark regresses beyond a threshold, a scan that fails the build on a dependency with a known critical CVE, a check that no service talks directly to another service's database.

This is what turns governance from a meeting into a mechanism. A rule enforced by review is enforced when the reviewer is paying attention; a rule enforced by a build failure is enforced always, including at 2 AM on a Friday.