Chidamber & Kemerer Suite of Metrics
Chidamber & Kemerer Suite of Metrics
Chidamber & Kemerer Suite of Metrics
Suite of Metrics
1
CK Metrics: Outline
• Objective
• Thresholds
2
CK Metrics: Objective
3
Object metrics
• Some of traditional metrics are useful with oo software:
• size measures for methods and classes
• complexity measures for methods
• comment percentage
• But new metrics are necessary for oo features (inheritance,
polymorphism, etc.)
• Metrics suite: set of metrics to measure different aspects of software.
E.g.:
• MOOD (Metrics for Object Oriented Design)
• The CK Metrics Suite (Chidamber & Kemerer)
• Metrics Proposed by Lorenz and Kidd
The CK Metrics Suite (1994)
• Viewpoints
7
CK Metrics: Definition
DIT (Depth of Inheritance Tree)
• Definition
The maximum length from the node to the root of the tree
• Viewpoints
The greater values of DIT :
– The greater the NOM it is likely to inherit, making more COMPLEX to
predict its behaviour
– The greater the potential RE-USE of inherited methods
8
CK Metrics: Definition
NOC (Number of Children)
• Definition
Number of immediate subclasses subordinated to a class in the class
hierarchy
• Viewpoints
The greater the NOC is:
– the greater is the RE-USE
– the greater is the probability of improper abstraction of the parent
class,
– the greater the requirements of method's TESTING in that class.
9
CK Metrics: Definition
CBO (Coupling Between Objects)
• Definition
It is a count of the number of other classes to which it is coupled
• Viewpoints
10
CK Metrics: Definition
RFC (Response for Class)
• Definition
It is the number of methods of the class plus the number of methods
called by any of those methods.
• Viewpoints
If a large numbers of methods are invoked from a class (RFC is high):
– TESTING and MAINTANACE of the Class becomes more COMPLEX.
11
CK Metrics: Definition
LCOM (Lack of Cohesion of Methods)
• Definition
Measures the dissimilarity of methods in a class via instanced variables.
• Viewpoints
Great values of LCOM:
– Increases COMPLEXITY
– Does not promotes ENCAPSULATION and implies classes should
probably be split into two or more subclasses
– Helps to identified low-quality design
12