Professional Documents
Culture Documents
• Product Metrics
All copyright information MUST appear if these slides are posted on a website for student
use.
PRODUCT OPERATION
Correctness Usability Efficiency
Reliability Integrity
These slides are designed to accompany Software
Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2
2009). Slides copyright 2009 by Roger Pressman.
A Comment
19
Object Oriented Metrics
20
Object Oriented Metrics
Size Metrics:
Number of Methods per Class (NOM)
21
Object Oriented Metrics
Coupling Metrics:
• Response for a Class (RFC )
– Number of methods (internal and external) in a class.
22
Object Oriented Metrics
23
Object Oriented Metrics
Cohesion Metrics:
LCOM: Lack of cohesion in methods
– Consider a class C1 with n methods M1, M2…., Mn. Let (Ij)
= set of all instance variables used by method Mi. There
are n such sets {I1},…….{In}. Let
P {( Ii , I j ) | Ii I j 0} and Q {( (Ii , I j ) | Ii I j 0}
If all n {( I1},.........(In)}sets are 0 then P=0
LCOM | P | - | Q |, if | P | | Q |
0 otherwise
24
Object Oriented Metrics
25
Object Oriented Metrics
Inheritance Metrics:
26
Object Oriented Metrics
Inheritance Metrics:
• AIF- Attribute Inheritance Factor
– Ratio of the sum of inherited attributes in all classes of the
system to the total number of attributes for all classes.
TC
A d (Ci )
AIF i 1
TC
i 1
Aa(Ci )
Aa(Ci ) Ai(Ci ) Ad (Ci )
Inheritance Metrics:
• MIF- Method Inheritance Factor
– Ratio of the sum of inherited methods in all classes of the
system to the total number of methods for all classes.
TC
Mi(Ci)
MIF i 1
TC
i 1
Ma(Ci)