skip to content

Distinguish architectural erosion from architectural drift, explain how a system becomes a "big ball of mud", and describe concrete mechanisms for preventing both.

level: seniorimportance: must knowfreq 55%

answer

  1. Perry & Wolf 1992: erosion = violation, drift = insensitivity
  2. Drift kills conceptual integrity without breaking a rule
  3. Big ball of mud — Foote & Yoder 1997; forces, not incompetence
  4. Fitness functions in CI catch erosion, not drift
  5. Strangler fig over big-bang rewrite; decision records survive turnover

basics

~20 s

Erosion is when code violates the intended architecture — for example a layer calling something it is not allowed to call. Drift is when things are added that the architecture never covered, so the design loses coherence without any explicit rule being broken. Both, left unchecked, end in a structureless "big ball of mud".

solid answer

~50 s

Perry and Wolf (1992) separated two decay modes. **Erosion** is direct violation of the intended architecture: dependency-rule breaches, a UI layer reaching into the database, a module bypassing another module's public interface. **Drift** is insensitivity rather than violation: additions that break no stated rule but are made without reference to the architecture, so conceptual integrity dissolves — three ways to do caching, four HTTP clients, boundaries that no longer match the domain. Erosion is detectable mechanically; drift usually is not, which makes it the more insidious of the two. Both converge on Foote and Yoder's **big ball of mud**: haphazard, sprawling, duplicated, structure-free code, driven by schedule pressure, turnover, throwaway code that outlives its purpose, and an architecture that exists only in someone's head. Prevention is continuous, not heroic: an explicit, published architecture; automated fitness functions in CI enforcing dependency rules; decision records so intent survives turnover; regular structure review; and incremental restructuring — strangler fig rather than big-bang rewrite.

go deeper

for a junior

Define both terms with one concrete example each — a forbidden call for erosion, a second competing caching approach for drift — and say that unchecked they produce a structureless system.

for a middle

Attribute the distinction to Perry and Wolf, list detection signals (cycles, shotgun surgery, rising lead time), and name automated dependency checks as the defence against erosion.

for a senior

Argue that drift is the harder problem because nothing is individually wrong, explain fitness functions in CI, decision records against turnover, and incremental strangulation over rewrite. Explain the forces Foote and Yoder identified rather than blaming teams.

for a principal

Frame it as an ongoing investment decision: which boundaries are worth enforcing mechanically, which characteristics get fitness functions, how ownership is aligned to boundaries per Conway's law, when sacrificial architecture is the correct deliberate choice, and how to present a strangulation programme as risk-managed delivery rather than a feature freeze.

## The two decay modes Dewayne Perry and Alexander Wolf's 1992 paper *Foundations for the Study of Software Architecture* introduced the distinction that is still the standard vocabulary. **Architectural erosion** — changes that **violate** the intended architecture. Someone imports across a forbidden boundary, a presentation component queries the database directly, one module reaches into another's internals instead of using its published interface, a supposedly asynchronous integration becomes a synchronous call "just this once". There is a rule, and it is broken. **Architectural drift** — changes made in **insensitivity** to the architecture. No stated rule is broken; the additions simply were not informed by the design intent. Symptoms: three caching approaches, four HTTP clients, two competing validation styles, a new capability lodged in whichever module was convenient, boundaries that no longer reflect the domain because the domain moved and the boundaries did not. The loss is of **conceptual integrity** — Fred Brooks' term for a system behaving as though designed by one mind. Why the distinction is practical: **erosion is mechanically detectable** — it is a rule violation, and rules can be encoded in automated checks. **Drift usually is not**, because nothing is technically wrong with any individual change; only the aggregate is incoherent. Drift is therefore caught by human review, architecture-description upkeep, and periodic structural assessment, not by CI alone. Teams that install dependency checks and declare victory have addressed only half the problem. ## The big ball of mud Brian Foote and Joseph Yoder (1997) named the most common architecture in practice: a haphazardly structured, sprawling, sloppy, spaghetti-code jungle — information promiscuously shared, near-global data access, and no discernible structure. Their key contribution was to explain it not as incompetence but as the predictable result of real forces: - **Time and cost pressure** — structure is invisible to customers, so it is the first thing cut. - **Experience and skill** — teams cannot build a structure they cannot yet see. - **Turnover** — design intent lives in people; when they leave and it was never written down, later changes cannot be sensitive to it. - **Piecemeal growth** — many locally reasonable changes summing to a globally unreasonable structure. - **Throwaway code that survives** — the prototype ships, then accretes features for a decade. - **Success** — mud is often what a system that *survived* long enough to matter looks like. A ball of mud is genuinely locally optimal for a while: anyone can change anything quickly. The cost arrives later as unbounded change impact — every modification can affect anything, so nothing can be reasoned about locally, estimates become unreliable, and change failure rate rises. ## Detection signals - Cyclic dependencies between modules or packages. - Change coupling: files with no logical relationship repeatedly committed together. - Shotgun surgery — one conceptual change touching many modules. - Rising lead time for changes of comparable size; widening estimate variance. - Onboarding time increasing over releases. - Nobody able to draw the system's structure — and no two drawings agreeing. - "Everything depends on the shared/common/util module." ## Prevention and recovery mechanisms **Make the architecture explicit.** An undocumented architecture cannot be violated knowingly or respected reliably. Lightweight diagrams plus **architecture decision records** capturing the decision, its context, alternatives and consequences give later engineers what they need to stay sensitive to intent — the main antidote to drift under turnover. **Automate the rules — fitness functions.** From *Building Evolutionary Architectures* (Ford, Parsons, Kua): an architectural fitness function is any automated test of an architectural characteristic. Concretely: dependency-rule tests that fail the build when a forbidden import appears, cycle detection, layer checks, module-boundary verification, performance and startup budgets, security policy checks. Run them in CI on every change so erosion is caught at the commit that causes it rather than at an annual review. This converts architecture from documentation into an executable constraint. **Small, verified structure changes.** Prefer continuous restructuring over accumulate-then-rewrite. Big-bang rewrites are the classic response and usually the wrong one: they freeze feature delivery, carry unknown behavioural-parity risk, and are exposed to the second-system effect (over-engineering the replacement). The **strangler fig** pattern — route traffic incrementally to new components while the old system shrinks — keeps value flowing and risk incremental. **Adjust boundaries as the domain is learned.** Much drift is boundaries that were reasonable initially and are now wrong. Treat module boundaries as revisable, informed by change-coupling data and domain analysis rather than by the original org chart. **Sacrificial architecture.** If you knowingly build something to be replaced (to learn the domain fast), say so explicitly, keep it isolated behind interfaces, and plan its replacement — converting inevitable decay into a deliberate, prudent decision instead of an accident. **Guard the seams organisationally.** Because team structure shapes system structure (Conway's law), boundaries that cut across team lines erode fastest. Align ownership with the boundaries you want preserved, and make each boundary's public interface someone's explicit responsibility.

  • Which of the two is harder to defend against, and why?
    Drift. Erosion is a rule violation, so it can be encoded as an automated check that fails the build. Drift breaks no rule — each change is individually defensible — so it can only be caught by keeping the architecture explicit and reviewed, watching for duplicated approaches to the same concern, and periodically re-examining whether boundaries still match the domain.
  • When is a rewrite actually the right response to a big ball of mud?
    Rarely, and only with specific conditions: the existing behaviour is well understood or cheaply characterised by tests, the business can tolerate a long period with no new features, the technology platform itself is a hard blocker (unsupported runtime, unobtainable skills), and the scope can be cut into independently shippable slices. Otherwise incremental strangulation, guarded by fitness functions so the replacement does not decay the same way, dominates on risk.
  • How does Conway's law relate to architectural erosion?
    Communication structures shape system structures, so a boundary that does not correspond to a team boundary has no natural guardian and tends to erode first — cross-team calls quietly become direct dependencies. Aligning ownership with the boundaries you want preserved, and giving each interface an accountable owner, makes the intended structure the one the organisation naturally reinforces.

Erosion is a tenant knocking a hole through a load-bearing wall — a clear violation of the plan. Drift is fifty tenants each adding their own extension, none breaking a rule, until the building has four incompatible heating systems and nobody can say what shape it is. Both end with a structure no architect would recognise, but only the first shows up on an inspection checklist.

saying these in an interview costs you the question

  • Using "erosion" and "drift" interchangeably, losing the point that only one is mechanically detectable
  • Claiming CI dependency checks alone prevent architectural decay — they do nothing about drift
  • Treating a big ball of mud as pure incompetence rather than the predictable outcome of pressure, turnover and piecemeal growth
  • Proposing a full rewrite as the default remedy
  • Believing a written architecture document alone prevents erosion without automated enforcement
  • Assuming boundaries drawn at project start should never move as the domain is understood

context