Professional Documents
Culture Documents
Lecture 8 - Object Oriented Software Metric
Lecture 8 - Object Oriented Software Metric
Metric
Weighted Methods per Class
(WMC)
• The effort in developing a class will in some sense will be
determined by the number of methods the class has and the
complexity of the methods.
• Suppose a class C has methods M1, M2... Mn defined on it. Let the
complexity of the method M1 be c1, then
i n
WMC = c
i 1
i
C D E G
a1 Pairs:
a2 (A1, A2), (A1, A3), (A1, A4), (A2, A3), (A2, A4),
a3 (A3, A4)
a4
P = 2 (Non-Cohesive pairs)
A1(a1, a2) Q = 4 (Cohesive pairs)
A2(a1)
A3 (a4) Q>P
A4 (a1, a4)
LCOM = 0