The third class metrics investigates cohesion. Any measure of separateness of methods helps identify flaws in the design of classes. Lower percentages mean greater cohesion of data and methods in the class. Methods are more similar if they operate on the same attributes. 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.