C&K metrics for Object Oriented Design

There is a huge need for process improvement in software development as 70% percent of the projects are below satisfactory level. One of the prominent approaches of design being used today is the object oriented modelling. There is a need for a suite of metrics to help a manager to measure the design especially when adopting to a new technology or when stepping into a new terrain.

Some of the metrics that were proposed before C&K metrics were subject to criticisms such as lacking a theoritical basis, lacking desirable measurement properties, being insufficiently generalized or being labor intensive to collect.

Six metrics were presented by Chidember and Karemer and they provided a method to collect them and also validated them based on a previously established measurement principles. The highlights of the paper that they presented was a theoritical ground for the metrics.

A OO Design can be conceptualized as a relational system consisting of a set of elements(classes, objects) , a set of relations and a set of binary operations performed on the elements. DΞ(A, R1…Rn, O1….On). A is set of object elements. R1….Rn are empirical relations of object element A and O1….On are binary operations on element A. This definition is now mapped onto a formal system F to provide mathematical basis. If a is an element in D, then μ(a) is an element in F.  μ does not make implicit changes to a. Example: Heights of school children can be mapped onto real numbers. Taller can be described as 36 inch child > 30 inch child. Children standing atop one another are mapped to adding real numbers.

An ontology is described where the design would be viewed as composed of things referred to as substantial individuals and concepts. The key is that substantial individual  possess properties inherently. The six metrics are

Coupling

Two objects are coupled if and only if at least one of them acts upon the other. X is said to act upon Y if the history of Y is affected by X. In order to find coupling between object classes, the software engineer must consult CRC cards and count the number of collaborations listed for the class.

Coheshion

The degree of similarity of the methods within the object can be defined to be the intersection of  the sets of variables used by the methods. A software engineer can measure cohesion by first picking an attribute and counting the number of CRC cards that access that attribute.

Complexity of an object

Cardinality of its set of properties. To guage weighted methods per class, software engineer must compute the complexity of the method.

Scope of properties: 1)Depth of inheritance: Software engineer must consult the inheritance tree and traverse it till the deepest child and find the depth.
2)Number of children: Software engineer must consult the Inheritance tree and calculate the number of children that are one level below the class under abstraction

Methods as measures of communication

A message can invoke a behaviour by calling another method. A software engineer must take the firat message and count the number of methods that can be potentially executed as a response to that message.

Combination of object classes

Additive aggregation of 2(or more) things like the combination of 2 object classes results in another class whose properties are the union of the properties of component classes.

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: