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
- Evolutionary architecture
Evolutionary architecture is the design approach that explicitly plans for architectural change over time — building in fitness functions, modular boundaries, and incremental migration paths so the architecture can evolve without big-bang rewrites.
- Modular monolith
A modular monolith is a single deployable application internally organised into well-defined modules with explicit boundaries, typed contracts between modules, and independent ownership.
- Clean architecture
Clean architecture, presented by Robert C.