Description:
Reuse in Descendants
The RD Metric
Definition 1 (Reuse in Descendant-class - RD)
The RD metric between a class C and one
of its descendant classes D is formally expressed as:
| i= nC | |||
| RD(C; D) | = |
|
RDD(mi;D) / nC |
| i = 1 | |||
where mi (i = 1; nC) represent the usable class members of C.
Explanations The RD metric quantities the totalized reuse of all the members of a class C, in one of its descendant classes. The degree to which a particular member is reused in a descendant class is variable. We consider that the way this reuse degree is calculated depends on the goals of the measurement. Analogous to RA we decided to parameterize the metric with a family of metrics called Reuse Degree in Descendant-class (RDD), that quantities this reuse degree. A description of this family of metrics is presented below.
The RDD Metrics
Definition 2 (Reuse Degree in Descendant Class) A function expressing the measure of reuse of a class member mC class C in a descendent class D is called Reuse Degree of mC in Descendant-class D.
RDD : SMCX SDCC-- [0; 1]
where C is the set of all members in class C and SDCC is the set of descendant classes D for class C.
Unitary RDD - RDDunit The Unitary Reuse
Degree in Descendant-class is defined as:
| RDDunit(mC; D)= | { | 1 if mC is used in at least one method of class D |
| 0 if mC is not used at all in class D |
The Total RD Metric - TRD
In the previous sections we defined the RD metric with two parameters: a particular class and a descendant of that class. In the same way we defined TRA we also considered that it is necessary to define a metric that expresses the total value for the reuse of a class by all its descendants.
We considered following two viewpoints for the interpretation of this metric.
In proposing these two viewpoints, we observed that because their focus is strongly different it would be quite impossible to have a single definition for TRD. So we proposed a definition for each one of the two viewpoints:
Definition 3 (Descendants-based Definition of TRD)
The Total Reuse in Descendants metric for a class C
is defined as the sum of all RD values between class C
and its descendants. This can be formally expressed as:
| i = nD | |||
| TRD(C) | = |
|
RD(C;Di) |
| i = 1 | |||
where nD represents the number of descendant-classes for class C, and Di is the iterator of its descendants.
Source: Ing. Radu Marinescu. An Object Oriented Metrics Suite on Coupling. Universitatea "Politehnica" Timisoara, Facultatea de Automatica si Calculatoare, Departamentul de Calculatoare si Inginerie Software. September, 1998.