Académique Documents
Professionnel Documents
Culture Documents
M a in ta in a b ility P o r ta b ility
F le x ib ility R e u s a b ility
T e s ta b ility
IIn
n te r o p e r a b ilit y
P R O D U C T R E V IS IO N P R O D U C T T R A N S IT IO N
P R O D U C T O P E R A T IO N
C o rre c tn e s s U s a b ility E ff ic ie n c y
R e lia b ility I n te g r ity
Why Metrics?
objective consistent
normative reliable
amenable to useful
statistical analysis valid
comparable
repeatable
Viewpoints
Objective: Low 9
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
Objective: Trade-off
10
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.
Viewpoints
Objective: Low
12
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.
Objective: Low
13
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
Objective: Low
14
CK Metrics: Guidelines
METRIC GOAL LEVEL COMPLEXITY RE-USABILITY ENCAPSULATION,
MODULARITY
(To develop, to test
and to maintain)
WMC Low ▼ ▼ ▲
DIT Trade-off ▼ ▼ ▼
▲ ▲ ▲
NOC Trade-off ▼ ▼ ▼
▲ ▲ ▲
CBO Low ▼ ▼ ▲
RFC Low ▼ ▼
LCOM Low ▼ ▼ ▲
15
Metrics for Object Oriented Design
Mood Suite
By Fernando Brito e Abreu
Inheritance
Method Inheritance Factor (MIF):
the ratio of the sum of the inherited methods in all
classes of the system under consideration to the total
number of available methods ( locally defined plus
inherited) for all classes.
MOOD conclusion
not appropriate for projects relying mostly on forms and
standard modules