Cohesion Metrics: What Each One Actually Measures

The cohesion survey [1] reviews every metric in the literature that carries a “cohesion” label: 24 metrics, from LCOM1 (1994) to MOGA (2010). Its finding is stark: every one of them measures a structural property of the code — shared fields, call connections, dependency edges, execution traces — and none measures cohesion itself. The proliferation is itself a symptom: the field has never agreed on what cohesion is, so each metric chose a different structural graph to stand in for the concept.

This page summarizes what each metric actually measures. For the series’ positive account — cohesion as correctness relative to a partitioning rule — see core conclusions.

1 Measuring cohesion by its absence

The best-known family is literally named for a lack: LCOM stands for Lack of Cohesion in Methods. Higher LCOM means less cohesion. This is not a polarity quirk that a sign change would fix. An LCOM variant counts something structural — method pairs that do not share fields, connected components that are absent — and negating the score yields only the negation of the proxy, not cohesion.

There is a deeper confusion beneath the naming. Every LCOM variant operates on the method–attribute access graph: the raw input is a coupling relation. LCOM counts pairs for which that coupling does not hold and reports the count as cohesion. By its own data, the LCOM family is a family of coupling metrics that have been called cohesion metrics since their origin.

2 The table

The table below lists all 24 metrics, grouped by which coupling relation they extract. Every row computes a transformation of a coupling graph; no row measures cohesion directly.

2.1 Method–attribute coupling

Metric Authors (year) What it measures
LCOM1 Chidamber, Kemerer (1994) Method pairs with disjoint attribute sets: P−QP - Q clamped to zero
LCOM2 Chidamber, Kemerer (1994) Same as LCOM1, clamped at zero
LCOM3 Li, Henry (1993) Connected components in the method–attribute graph
LCOM4 Hitz, Montazeri (1995) Connected components with method-call edges added to the graph
LCOM5 Henderson-Sellers (1996) Average, over all attributes, of the fraction of methods not accessing each
TCC Bieman, Kang (1995) Fraction of method pairs directly connected through shared attribute access
LCC Bieman, Kang (1995) TCC plus indirect connections through intermediate methods
DCd Badri, Badri (2004) Relative number of directly connected method pairs
DCi Badri, Badri (2004) Relative number of directly or transitively connected pairs
CC Bonja, Kidanmariam (2006) Jaccard similarity of the attribute sets referenced by each method
SCOM Fernández, Peña (2006) Intersection-over-union of attribute sets per method pair
PCCC Al Dallal (2012) Count of simple paths in the method–attribute connectivity graph
MMAC Al Dallal (2007) Average cohesion of method pairs through shared attributes
ICBMC Xu, Zhou (2001) Connectivity factor × structure factor of the member–attribute graph
OLn Yang (2002) Iterated common attribute strength (limit of a recursive weighting)

2.2 Dependency coupling

Metric Authors (year) What it measures
RCI Briand et al. (1994) Ratio of internal interactions to the maximal possible
NRCI Briand et al. (1994) RCI excluding unknown interactions from the denominator
PRCI Briand et al. (1994) RCI with unknown interactions treated as non-interactions
ORCI Briand et al. (1994) RCI with unknown interactions treated as actual interactions

2.3 Data-slice coupling

Metric Authors (year) What it measures
SFC Bieman, Ott (1994) Tokens shared between output data slices
WFC Bieman, Ott (1994) Any data token shared between slices (weaker criterion)

2.4 Execution-trace coupling

Metric Authors (year) What it measures
SFC/WFC (execution-slice variant) Gupta et al. (2001) Method pairs in the same execution slice (dynamic slicing)
exPubMet / priMet Mitchell, Power (2003) External vs. internal method invocations from runtime GUI traces
MOGA Bowman et al. (2010) Message-passing coupling + attribute access as a refactoring-search fitness

3 Why this matters

The metrics differ in which coupling relation they extract, which transformation they apply, and which normalisation they prefer. They do not differ in what they measure: all measure coupling and report it as cohesion.

This has three practical consequences, developed in the survey:

  • The cohesion–coupling tradeoff is an artifact of measurement convention. Cohesion metrics count internal edges and coupling metrics count cross-boundary edges of the same graph. Designers balancing the two are balancing one dependency relation against itself under two labels.

  • A high score can mask a mess. When elements that belong apart happen to share many fields or call each other, LCOM, TCC, and LCC all report high cohesion. Structurally cohesive modules receive a quality signal the metric cannot support.

  • LCOM-triggered refactoring can reward the wrong direction. Standard heuristics treat LCOM thresholds as extract-class triggers. But LCOM detects structural clustering, not principled misgrouping.

None of this makes the metrics useless. Correlation with fault-proneness and maintenance effort has been reported across multiple studies, so structural scores work as screening heuristics and change predictors. The limitation is interpretative: the score measures coupling density, and domain knowledge about grouping conditions is needed to say more.

4 Where the series goes from here

The survey establishes the negative result: no structural metric measures principled cohesion. Later papers in the cohesion series give cohesion a positive definition — correctness relative to a partitioning rule — and derive a metric from the reason elements change rather than from the footprint of their co-location. See core conclusions and knowledge embodiment.

5 References

[1]
Y. Loth, “Cohesion metrics: A survey of the literature.” Zenodo, Jul. 2026. doi: 10.5281/zenodo.21703227.

The formal development. The definitions, theorems, and proofs behind this page are published in:

All published papers