| Object Oriented Metrics |
| » Kenneth L. Morris |
| Candidate Metrics for Productivity Measurement: |
It was seem that extensibility will suffer if the number of methods per object class gets too large.
A larger number of methods per object class is likely to complicate testing due to the increased object size and complexity.
Total No. of Methods
Average No. of Methods per Object Class = --------------------------
Total No. of Object Classes
also defined: Maximum No. and Minimum No. of Methods per Object Class
A deep inheritance tree may be more difficult to test than a broad one.
Comprehensibility may also be diminished with a large number inheritance layers.
Inheritance Tree Depth = max{Inheritance Tree Path Length}
The higher the degree of object independence (i.e. the more 'uncoupled' objects are from each other) the more likely it is that objects will suitable for reuse within the same applications and within other applications.
Uncoupled objects should be easier to augment than those with a high degree of 'uses' dependencies, due to the lower degree of interaction.
Testability is likely to degrade with a more highly coupled system of objects.
Object interaction complexity associated with coupling can lead to increased error generation during development.
Total No. of Arcs
Average No. of Uses Dependencies per Object = -------------------
Total No. of Objects
Arcs - in an Object Uses Network
Maximum No. = max{No. of Uses Arcs}
Arcs - attached to any single object in a uses network
Low cohesion is likely to produce a higher degree of errors in the development process. Low cohesion adds complexity which can translate into a reduction in application reliability.
Total Fan-in for All Objects
Degree of Cohesion of Objects = ----------------------------
Total No. of Objects
Average Number of Times a Library Object is Reused:
Total Number of Object Reuses
Average Number = -----------------------------
Total Number of Library Objects
also defined: Percent of Library Objects in an Application
The more highly factored an inheritance hierarchy is the greater degree to which method reuse is likely to occur.
Highly factored applications are likely to be more reliable for reasons similar to those which argue that such applications are more maintainable. The smaller the number of implementation locations for the average task, the less likely that errors were made during coding
Number of Unique Methods
Factoring Effectiveness = ------------------------
Total Number of Methods
Percent of Potential Method Uses Actually Reused (PP):
Total Number of Actual Method Uses
PP = ------------------------------------ x 100
Total Number of Potential Method Uses
Percent of Potential Method Uses Overridden (PM):
Total Number of Methods Overridden
PM = ------------------------------------- x 100
Total Number of Potential Method Uses
Greater method complexity is likely to lead to a lower degree of overall application comprehensibility.
Greater method complexity is likely to adversely affect application reliability.
More complex methods are likely to be more difficult to test.
Sum of the V(G) of all Methods
Average Method Complexity = ----------------------------------
Total Number of Application Methods
V(G)=e-n+2 (McCabe measure)
An application constructed with more finely granular objects (i.e. a lower number of functions per object) is likely to be more easily maintained because objects should be smaller and less complex.
More finely granular objects should also be more reusable. ... Therefore, each object's behavior should be more easily understood and analyzed.
Total Number of Objects
Application Granularity = -------------------------
Total Function Points"
SMlab's Homepage
<dumke@ivs.cs.uni-magdeburg.de>
|
Last modified:
| | |