Incoprea Theory
Volume VIII · 100

Theory 070/Information & Computation /Software engineering

Complexity Is Interface Count

Complexity is measured in lines. The cost of change may be the number of contracts you must renegotiate.

The claim

Software complexity is set by the number of interfaces between components rather than by lines of code, so a small system with many interfaces is harder to change than a large system with few.

01The evidence

Maintenance cost concentrates in integration and in cross-module changes, which scale with interface count rather than with code volume.

02The tension

Complexity metrics use size, which is easy to compute and predicts change cost poorly. Interface count is rarely measured.

03The mechanism

Changing a component requires changing everything that depends on its contract. The number of contracts is the number of interfaces, and the cost of a change scales with how many must be renegotiated.

That makes interface count the complexity measure, and predicts change cost should track it better than lines of code across systems.

04What this is not

Size-based complexity metrics

Size metrics predict cost from volume. This predicts from contracts, which explains expensive changes in small systems.

05Predictions

  • P1Change cost should track interface count better than lines.
  • P2Small systems with many interfaces should be harder to change.
  • P3Interface reduction should lower cost.

06Refutation

Change cost tracking size at controlled interface count would restore size metrics.

07What it changes

It would change how modularity is evaluated.