metric

Afferent and Efferent Coupling

The counts of components depending on a module and of components it depends upon, used together to identify which parts of a system are expensive to change.

Afferent (incoming) — how many things depend on this module. High afferent coupling means changes here are expensive and risky, which is appropriate for a stable shared abstraction and dangerous for something still evolving.

Efferent (outgoing) — how many things this module depends on. High efferent coupling means it breaks when any of them changes, and it is hard to test or reuse in isolation.

Together they locate the parts of a system where change is costly, and they do so from the code rather than from opinion — which is what makes them useful in an argument about where to invest.

Instability = efferent / (afferent + efferent), ranging from 0 (nothing depends on it, it depends on everything) to 1. The associated guidance: depend in the direction of stability, so a volatile module may depend on a stable one and not the reverse.

The pathological combination is high afferent and high efferent together — a module everything depends on that itself depends on everything. It cannot be changed safely and cannot be tested in isolation, and it is almost always the component people describe as "the part nobody wants to touch".