Abstract

Various class cohesion metrics exist in literature both at design level and source code level to assess the quality of Object Oriented (OO) software. However, the idea of cohesive interactions (or relationships) between instance variables (i.e., attributes) and methods of a class for measuring cohesion varies from one metric to another. Some authors have used instance variable usage by methods of the class to measure class cohesion while some focus on similarity of methods based on sharing of instance variables. However, researchers believe that such metrics still do not properly capture cohesiveness of classes. Therefore, measures based on different perspective on the idea of cohesive interactions should be developed. Consequently, in this paper, we propose a source code level class cohesion metric based on instance variable usage by methods. We first formalize three types of cohesive interactions and then categorize these cohesive interactions by providing them ranking and weights in order to compute our proposed measure. To determine the usefulness of the proposed measure, theoretical validation using a property based axiomatic framework has been done. For empirical validation, we have used Pearson correlation analysis and logistic regression in an experimental study conducted on 28 Java classes to determine the relationship between the proposed measure and maintenance-effort of classes. The results indicate that the proposed cohesion measure is strongly correlated with maintenance-effort and can serve as a good predictor of the same.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call