All glossary terms
Design

Architecture fitness function

An architecture fitness function is an executable test that asserts an architectural characteristic — coupling between modules, cyclic-dependency absence, response-time budget, dependency direction. Fitness functions encode architectural intent in CI so the architecture doesn't silently drift as code evolves.

The concept comes from Building Evolutionary Architectures (Ford, Parsons, Kua, 2017). The argument: architectural intent stated in documents drifts as code evolves; architectural intent encoded as a CI check stays enforced. Common fitness functions: a layered-architecture rule that web→service→data dependencies are allowed but reverse is forbidden; a maximum cyclomatic complexity per function; an upper bound on cross-module imports; a maximum API response time under load. Tools include ArchUnit (Java), Modular (TypeScript via dependency-cruiser), language-agnostic linters. The discipline pays back because architectural drift is invisible until it's expensive; fitness functions surface it immediately.

Discussed in our use-cases

ICP-targeted pages where architecture fitness function is part of the framing.

Related terms