???
Coupling Between Object classes
(CBO). Two classes are coupled when methods declared in one
class use methods or instance variables of the other class [Chidamber 2].
FIGURE 14.1
Classes and subclasses
Example:
This hierarchy has a DIT factor of 4
Superclass S
Subclass S1 Subclass S2
Subclass S12 Subclass S21 Subclass S22 Subclass S23
Subclass S221
average method complexity
cyclomatic complexit
=
y
all methods
all methods ??‘
??‘
234
Manage Software Testing
Note that there is a large number of object-oriented metrics in the literature many of which are proposed
as determiners of test rigor.
14.4.1 Coefficients of Object-Oriented Metrics
The coefficients of the metrics are shown in Table 14.1 (taken from [Basili 96]):
???
Coefficient
is the estimated regression coefficient. The larger the coefficient, the stronger the impact
(positive or negative), according to its sign of the explanatory variable on the probability of a fault
being detected in a class.
???
Odds ratio
represents the ratio between the probability of having a fault and the probability of
not having a fault. Thus DIT correlates at 0.53 and its odds are 74% more probable that it contains
a fault than that it doesn??™t. The odds are metric-specific: don??™t use them to compare the metrics
since the metrics have different ordinal scales.
See section D.6 in Appendix D
for details of tools which will automatically extract these metrics.
Pages:
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453