Count the number of disjoint sets produced from the intersection of the sets of attributes used by the methods. High cohesion indicates good class subdivision. Lack of cohesion or low cohesion increases complexity, thereby increasing the likelihood of errors during the development process. Classes with low cohesion could probably be subdivided into two or more subclasses with increased cohesion. Classes are coupled when methods declared in one class use methods or attributes of the other classes.
Inheritance introduces significant tight coupling between superclasses and their subclasses.
The next object-oriented metric measures coupling strength. It is measured by counting the number of distinct non-inheritance related class hierarchies on which a class depends. Excessive coupling is detrimental to modular design and prevents reuse. The more independent a class is, the easier it is reuse in another application. The larger the number of couples, the higher the sensitivity to changes in other parts of the design and therefore maintenance is more difficult.