Open Access

Package level cohesion measurement in object-oriented software

Journal of the Brazilian Computer Society201118:52

Received: 25 December 2010

Accepted: 6 December 2011

Published: 22 December 2011


Packages are re-usable components for most of object-oriented systems. To promote reuse in object-oriented systems and to make deployment and maintenance tasks easy, packages in object-oriented systems must be cohesive. Quantification of cohesion of packages can be very useful in assessing their reusability, quality etc. In this paper, a new measure for the measurement of package cohesion is proposed. The cohesion of a package is measured in terms of the degree of intra-package dependencies among its elements. The hierarchical structure of packages has also been taken into account during the measurement. The proposed measure has been validated theoretically as well as empirically. An empirical study has been conducted using 25 packages taken from six open-source software projects developed in Java. The proposed package cohesion measure is found to be a useful indicator of external quality factors such as the reusability of packages. The proposed metric is also established as a better predictor of code reusability than the existing cohesion measures.


Cohesion Metrics Quality Reusability Packages Object-oriented software