The International Arab Journal of Information Technology (IAJIT)

..............................
..............................
..............................


An Investigation of Design Level Class Cohesion Metrics

 ,
#
 Design  level  class  cohesion  metrics  are  based  on  th e  assumption  that  if  all  the  methods  of  a  class  have  access  to  similar  parameter  types,  then  they  all  process  clos ely  related  information.  A  class  with  a  large  numbe r  of  parameter  types  common  in  its  methods  is  more  cohesive  than  a  class   with  less  number  of  parameter  types  common  in  its methods.  In  this  paper,  we  review  the  design  level  class  cohesion  me trics  with  a  special  focus  on  metrics  which  use  similarity  of  parameter  types  of  methods  of  a  class  as  the  basis  of  its  coh esiveness.  Basically  three  metrics  fall  in  this  category:  Cohesion  Among  Methods  of  a  Class  (CAMC),  Normalized  Hamming  Dista nce  (NHD),  and  Scaled  NHD  (SNHD).  Keeping  in  mind  t he  anomalies in the definitions of the existing metric s, a variant of the existing metrics is introduced.  It is named NHD Modified  (NHDM).  A  major  point  of  difference  is  that  the  NHD   metric  counts  a  disagreement  only  if  class  methods  taken  as  pairs  disagree  on  a  parameter  type  that  one  method  uses  b ut  the  other  method,  in  the  pair,  does  not  use.  It ignores  the  case  when  both  methods  of  a  pair  do  not  use  a  parameter  type.   NHD  indirectly  counts  it  as  an  agreement,  but  NHDM   considers  such  a  case  as  a  disagreement.  An  automated  metric  collect ion  tool  is  used  to  collect  the  metrics  data  from  an  open  source  Java  based software program containing 884 classes. Metr ics data is then subjected to statistical analysis. The NHDM metric shows  the  maximum  amount  of  variation  in  data  values  in  c omparison  to  other  metrics  in  the  group.  NHDM  is  st rongly  correlated  with CAMC. Unlike the previous studies, no signific ant correlation is found in CAMC and NHD.   


[1] Badri L. and Badri M., A Proposal of a New Class Cohesion Criterion: An Empirical Study, Computer Journal of Object Technology , vol. 3, no. 4, pp. 145-159, 2004.

[2] Bansiya J. and Davis C., A Hierarchical Model for Object Oriented Quality Assessment, Computer Journal of IEEE Transactions on Software Engineering , vol. 28, no.1, pp. 4-17, 2002.

[3] Bansiya J., Etzkorn L., Davis C., and Li W., A Class Cohesion Metric for Object Oriented Designs, Computer Journal of Object Oriented Programming , vol. 11, no. 8, pp 47-52, 1999.

[4] Bieman J. and Kang B., Cohesion and Reuse in an Object-Oriented System, in Proceedings of the Symposium on Software Reusability, ACM Press , USA, pp. 259-262, 1995.

[5] Bonja C. and Kidanmariam E., Metrics for Class Cohesion and Similarity between Methods, in Proceedings of the 44 th annual Southeast Regional Conference , New York, pp. 91-95, 2006.

[6] Briand L., Daly J., and Wust J., A Unified Framework for Cohesion Measurement in Object-Oriented Systems, Empirical Software. Enggnering , vol. 3, no. 1, pp. 65-117, 1998.

[7] Briand L., Wust J., Daly J., and Porter D., Exploring the Relationships Between Design Measures and Software Quality in Object Oriented Systems, Conference Systems and Software , vol. 51, no. 3, pp. 245-273, 2000.

[8] Chae H., Kwon Y., and Bae D., A Cohesion Measure for Object-Oriented Classes, Computer Journal of Software Practice and Experience , vol. 30, no. 12, pp. 1405-1431, 2000.

[9] Chen Z., Zhou Y., and Xu B., A Novel Approach to Measuring Class Cohesion Based on Dependence Analysis, in Proceedings of the International Conference on Software Maintenance , USA, pp. 377-384, 2002.

[10] Chidamber P. and Kemerer C., Towards a Metrics Suite for Object Oriented Design, in Proceedings of 6 th ACM Conference on Object Oriented Programming, Systems, Languages and Applications , Arizona, pp. 197-211, 1991.

[11] Chidamber S. and Kemerer C., A Metrics Suite for Object Oriented Design, Computer Journal of IEEE Transactions on Software Engineering , vol. 20, no. 6, pp. 476-493, 1994.

[12] Counsell S., Swift S., and Crampton J., The Interpretation and Utility of Three Cohesion Metrics for Object-Oriented Design, Computer Journal of ACM Transactions on Software Engineering and Methodology , vol. 15, no. 2, pp. 123-149, 2006.

[13] Cox G., Etzkorn L., and Hughes W., Cohesion Metric for Object-Oriented Systems Based on Semantic Closeness from Disambiguity, Computer Journal of Applied Artificial Intelligence , vol. 20, no. 5, pp. 419-436, 2006.

[14] Dallal J., A Design-Based Cohesion Metric for Object-Oriented Classes, Computer Journal of World Academy of Science, Engineering and Technology , vol. 34, pp. 301-306, 2007.

[15] Dallal J. and Briand L., An Object-Oriented High-Level Design-Based Class Cohesion Metric, Technical Report , Simula Research Laboratory, 2009.

[16] Fern ndez L. and Pe a R., A Sensitive Metric of Class Cohesion, International Journal of Information Theories and Applications , vol. 13, no. 1, pp. 82-91, 2006.

[17] Gui G. and Scott D., Measuring Software Component Reusability by Coupling and Cohesion Metrics, Journal of Computers , vol. 4, no. 9, pp 797-805, 2009.

[18] Gyimothy T., Ferenc R., and Siket I., Empirical Validation of Object-Oriented Metrics on Open Source Software for Fault Prediction, Journal of Computers IEEE Transactions on Software Enineering , vol. 31, no. 10, pp. 897-910, 2005.

[19] Henderson-Sellers B., Constantine L., and Graham I., Coupling and Cohesion (Towards a Valid Metrics Suite for Object-Oriented Analysis and Design), Object Oriented Systems , vol. 3, no. 3, pp. 143-158, 1996.

[20] Hitz M. and Montazeri B., Measuring Coupling and Cohesion in Object-Oriented Systems, in Proceedings of International Symosium on Applied Corporate Computing , pp. 1-10, 1995.

[21] Lee J., Jung S., Kim S., Jang W., and Ham D., Component Identification Method with Coupling and Cohesion, in Proceedings of Eighth Asia-Pacific Software Engineering Conference , USA, pp. 79-86, 2001.

[22] Li W. and Henry S., Object-Oriented Metrics that Predict Maintainability, Conference System Software , vol. 23, no. 2, pp. 111-122, 1993.

[23] Makela S. and Leppanen V., Client Based Object Oriented Cohesion Metrics, in Proceedings of 31st Annual International An Investigation of Design Level Class Cohesion Metrics 73 Computer Software and Applications Conference , Beijing, pp. 743-748, 2007.

[24] Marchetto A. and Trentini A., A Framework to Build Quality Models for Web Applications, Computer Journal of The International Arab Journal of Information Technology , vol. 4, no. 2, pp. 168-176, 2007.

[25] Marcus M. and Poshyvanyk D., Using the Conceptual Cohesion of Classes for Fault Prediction in Object-Oriented System, Computer Journal of IEEE Transactions on Software Engineering , vol. 34, no. 2, pp. 287- 300, 2008.

[26] Marcus A. and Poshyvanyk D., The Conceptual Cohesion of Classes, in Proceedings of 21 st IEEE International Conference on Software Maintenance, USA, pp. 133-142, 2005.

[27] Wang J., Zhou Y., Wen L. Chen Y., Lu H., and Xu B., DMC: A More Precise Cohesion Measure for Classes, Computer Journal of Information and Software Technology , vol. 47, no. 3, pp. 167-180, 2005.

[28] Zhou Z. and Leung H., Empirical Analysis of Object-Oriented Design Metrics for Predicting High and Low Severity Faults, Computer Journal of IEEE Transactions on Software Engineering , vol. 32, no. 10, pp 771-789, 2006. Kuljit Kaur is a lecturer at the Department of Computer Science and Engineering, Guru Nanak Dev University, India. Her areas of interest are software engineering and object oriented analysis and design. Currently, she is working on software component evaluation metrics. She has 14 years of teaching experience. She received an MCA from Guru Nanak Dev University, Amritsar in 1996. Hardeep Singh is a professor at the Department of Computer Science and Engineering, Guru Nanak Dev University, India. His research interests are information system software metrics. He has 22 years of teaching and research experience. He received his PhD in computer science and engineering from Guru Nanak Dev University, Amritsar in 2003.