LOCOM1 - Lack of Cohesion of Methods 1

Takes each pair of methods in a class and determines a set of fields accessed by they each of them. If they have disjoint sets of field accesses, increments P count by one. If they share at least one field access then increases Q by one. After considering each pair of methods:

RESULT = (P > Q) ? (P - Q) : 0

A low value indicates high coupling between methods, which indicates high testing effort, since many methods can affect the same attributes and potentially low reusability. The definition of this metric was provided by Chidamber and Kemerer in 1993.