A New Cohesion Metric and Restructuring Technique for Object Oriented Paradigm

When software systems grow large during development and maintenance, they may lose their quality and become complex to read, understand and maintain. A software component should be of good quality for the readers of the code to find its intents clear and the code behavior obvious. When this is the case it will be less costly to maintain the code and when its intent is clear, the code will be reusable, which is one of the key features of object oriented programming. Several software quality metrics have been proposed to measure overall or partial quality of software units such as classes or procedures. Cohesion is one of the most widely used metrics to measure quality of a software unit in terms of the relatedness of its components. This work presents a new cohesion metric based on program slicing and graph theory for units using object oriented paradigm. One can make a judgment on clarity of intent of the code using the metric we propose here. We aim to find out if a class is cohesive, handling one specific operation. We identify all program statements which constitute operations in the same abstraction domain. When a class has more than one abstraction, this technique suggests a restructuring for generating more cohesive units based on this new cohesion metric.

[1]  David W. Binkley,et al.  Interprocedural slicing using dependence graphs , 1990, TOPL.

[2]  James M. Bieman,et al.  Program slices as an abstraction for cohesion measurement , 1998, Inf. Softw. Technol..

[3]  G. Serban,et al.  Restructuring software systems using clustering , 2007, 2007 22nd international symposium on computer and information sciences.

[4]  Mark David Weiser,et al.  Program slices: formal, psychological, and practical investigations of an automatic program abstraction method , 1979 .

[5]  Arun Lakhotia,et al.  Restructuring functions with low cohesion , 1999, Sixth Working Conference on Reverse Engineering (Cat. No.PR00303).

[6]  Martin Hitz,et al.  Measuring coupling and cohesion in object-oriented systems , 1995 .

[7]  Sallie M. Henry,et al.  Object-oriented metrics that predict maintainability , 1993, J. Syst. Softw..

[8]  Linda M. Ott,et al.  Slice based metrics for estimating cohesion , 1993, [1993] Proceedings First International Software Metrics Symposium.

[9]  Linda M. Ott,et al.  The relationship between slices and module cohesion , 1989, ICSE '89.

[10]  Sakari Karstu,et al.  An Examination of the Behavior of Slice Based Cohesion Measures , 1994 .

[11]  David W. Binkley,et al.  Slice-based cohesion metrics and software intervention , 2004, 11th Working Conference on Reverse Engineering.

[12]  James M. Bieman,et al.  Cohesion and reuse in an object-oriented system , 1995, SSR '95.

[13]  B. S. Gupta A Critique of Cohesion Measures in the Object-Oriented Paradigm , 1997 .

[14]  Doo-Hwan Bae,et al.  Improving cohesion metrics for classes by considering dependent instance variables , 2004, IEEE Transactions on Software Engineering.

[15]  S. Danicic,et al.  Cohesion Metrics , 1995 .

[16]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[17]  Chris F. Kemerer,et al.  Towards a metrics suite for object oriented design , 2017, OOPSLA '91.

[18]  James M. Bieman,et al.  Measuring Functional Cohesion , 1994, IEEE Trans. Software Eng..

[19]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[20]  Jens Krinke,et al.  Statement-Level Cohesion Metrics and their Visualization , 2007, Seventh IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2007).