Documente Academic
Documente Profesional
Documente Cultură
Design Metrics
Design Metrics are useful in measuring the
complexity and goodness of a design.
A large number metrics have been
proposed for OO designs.
Some of these have been validated
experimentally, others are mere proposals
or have received little or no validation.
October 23,
Design Metrics
Effort
Assumption: The effort in developing a class is
determined by the number of methods.
October 23,
Design Metrics
WMC
Let class C have methods M1, M2, .....Mn.
Let
M
i 1
October 23,
c
i
Design Metrics
WMC: validation
Most classes tend to have a small number
of methods, are simple, and provide some
specific abstraction and operations.
WMC metric has a reasonable correlation
with fault-proneness of a class.
October 23,
Design Metrics
October 23,
Design Metrics
DIT evaluation
Basili et al. study,1995.
Chidamber and Kemerer study, 1994.
October 23,
Design Metrics
Validation of NOC
Classes generally have a small NOC value.
Vast majority have NOC=0.
Larger NOC value is associated with lower
probability of detecting faults in that class.
October 23,
Design Metrics
Design Metrics
10
Validation of CBC
Most classes are self contained and have CBC=0.
October 23,
Design Metrics
11
Note that even when CBC=1 RFC may be high. This indicates
that the volume of interaction is high.
October 23,
Design Metrics
12
Validation of RFC
Most classes tend to invoke a small number of
methods (low RFC values).
Classes for interface objects tend to have larger
RFC values.
RFC is very significant in predicting the faultproneness of a class.
October 23,
Design Metrics
13
Design Metrics
14
LCOM [2]
A larger number of cohesive pairs implies smaller LCOM.
October 23,
Design Metrics
15
Summary
What are OO metrics?
Metrics for complexity, coupling, and
cohesion
October 23,
Design Metrics
16