A Metric for the Activeness of a Class
In this paper, the authors propose a software metric called Class Activeness Metric which helps to determine the level of accessibility of the members of a class when it is instantiated as objects. Object interactions need to be straight forward as far as possible as complexity in these interactions can lead to time delays in accessing members not just confusing inheritance hierarchies. For object interactions to be non-complex, the classes must be designed well so that they are easily accessible. This necessitates the development of a metric for gauging the quality of design of a class. This metric is the Class Activeness Metric.
💡 Research Summary
The paper introduces the Class Activeness Metric (CAM), a quantitative measure designed to assess how readily the members of a class can be accessed once the class is instantiated as objects. The authors begin by highlighting a fundamental problem in object‑oriented design: as the complexity of object interactions grows, the time required to locate and invoke class members increases, leading to performance degradation and maintenance difficulties. Existing quality metrics such as cohesion, coupling, and cyclomatic complexity capture structural relationships but do not directly reflect the cost of member accessibility. To fill this gap, the authors propose “activeness” as a property that captures the ease with which external code can reach a class’s members.
CAM is built from four primary factors. First, the number of public (Pu) and protected (Pr) members contributes positively to activeness because they are directly reachable from outside the class. Second, the number of private (Pv) and protected‑private (Prv) members contributes negatively, as they impose access restrictions. Third, the metric incorporates inheritance: members inherited as public or protected remain accessible in derived classes, so the depth and breadth of the inheritance hierarchy are weighted. Fourth, friend functions and friend classes (F) are accounted for because they grant special access to otherwise private members. The authors express CAM mathematically as
\
Comments & Academic Discussion
Loading comments...
Leave a Comment