A novel approach to measuring class cohesion based on dependence analysis

Classes are the basic modules in object-oriented (OO) software, which consist of attributes and methods. Thus, in an OO environment, cohesion mainly concerns how tight the attributes and methods of classes are. This paper discusses the relationships between attributes and attributes, attributes and methods, and methods and methods of a class based on dependence analysis. Then we discuss the properties of these relationships. According to these properties, this paper proposes a novel approach to measuring class cohesion. Our approach overcomes the limitations of previous class cohesion measures, which consider only one or two of the three relationships in a class. We also prove that this measure satisfies the properties that a good measurement should have.