Next: Response For a Class Up: Structural Complexity Previous: McCabe Cyclomatic Complexity (
Weighted Method Count (
)
Works with all instances of a common meta-model,
regardless of whether they were produced with the Java or the
UML front-end. The respective extends (Java) or
generalization (UML) relations expressing the inheritance
between two classes are mapped onto relations of type
inheritance in the common meta-model (and the specific view).
- Handle
- Description
- A weighted sum of methods implemented within a class. It is parameterized by a way to compute the weight of each method. Possible weight metrics are: This variant of uses McCabe Cyclomatic Complexity 3.1.3 metric for calculating the weight for each method. Originally defined as an object-oriented metric, it can easily adapted to non-object-oriented systems computing the weighted sum of functions implemented within a module or file.
- Scope
- Class
- View
-
- Grammar
- Relations
- Mapping
:
- Definition
-
The value of a class
is defined
as:
- Scale
- Absolute.
- Domain
- Integers .
- Highly Related Software Quality Properties
-
- Re-Usability 2.4
-
depends on the weight metric, which influences the
attributes assessed with WMC negatively or
positively.
Re-Usability declines with increasing unweighted WMC.
- Understandability for Reuse 2.4.1:
-
Understanding if a class is suitable for reuse
depends on the size of its interface.
Understandability declines with increasing unweighted WMC.
- Learnability for Reuse 2.4.2:
-
Learning if a class is suitable for reuse depends
on the size of its interface.
Learnability declines with increasing unweighted WMC.
- Operability for Reuse - Programmability 2.4.3:
-
How well a class can be integrated depends on the
size of its interface.
Programmability declines with increasing unweighted WMC.
- Attractiveness 2.4.4:
-
Attractiveness of a class depends on the size and
complexity of the potentially reused code.
Depending on the weight metric, WMC allows an
assessment of size or complexity.
Attractiveness increases with increasing unweighted WMC.
- Maintainability 2.6
-
declines with increasing WMC.
- Analyzability 2.6.1:
-
The effort and time for diagnosis of deficiencies
or causes of failures in a class, or for
identification of parts to be modified is
directly related to the size and complexity of
the class. Depending on the weight metric, WMC
allows an assessment of size or complexity.
Analyzability declines with increasing unweighted WMC.
- Changeability 2.6.2:
-
Changing a class requires prior understanding,
which, in turn, is more complicated for large and
complex systems. Depending on the weight metric,
WMC allows an assessment of size or complexity.
Changeability declines with increasing unweighted WMC.
- Testability 2.6.4:
-
Complete testing requires coverage of all
execution paths. The number of possible execution
paths of a class increases with the number of
methods and their control flow complexity.
Depending on the weight metric, WMC allows an
assessment of the number of methods and their
complexity.
Testability declines with increasing unweighted WMC.
- Portability 2.7
-
declines with increasing WMC.
- Adaptability 2.7.1:
-
As for changeability 2.6.2,
the size of software has a direct impact. Each
modification requires understanding which is more
complicated for large systems. Size is
specifically assessed by the weighted versions of
WMC.
Adaptability declines with increasing unweighted WMC.
- Replaceablity 2.7.4:
-
The substitute of a component must imitate its
interface. Large interfaces are difficult to
check for substitutability and to actually
substitute. Interface size is specifically
assessed by the unweighted WMC.
Replaceablity decline with increasing unweighted WMC.
- Related Software Quality Properties
-
- Functionality 2.1
-
might increase with increasing WMC.
- Interoperability 2.1.3:
-
Interoperability requires to be able to locate
the parts of a system responsible for
interoperability. The size of in these parts
might indicate a better ability to interact.
Interoperability might increase if the unweighted WMC increases.
- Security 2.1.4:
-
Relating WMC to security requires to be able to
locate the parts of a system responsible for
security. The size of these parts might indicate
a higher security.
Security might increase with increasing unweighted WMC.
- Reliability 2.2
-
might increase with increasing WMC.
- Maturity 2.2.1:
-
Due to reduced analyzability 2.6.1
and testability 2.6.4,
bugs mights be left in the software. Therefore,
also maturity may be influenced negatively by
WMC.
Maturity might decline with increasing unweighted WMC.
- Fault-tolerance 2.2.2:
-
Relating WMC to fault-tolerance requires to be
able to locate the parts of a system responsible
for fault-tolerance. The size of these parts
might indicate a better ability to interact.
Fault-tolerance might increase if the unweighted WMC increases.
- Recoverability 2.2.3:
-
Relating WMC to recoverability requires to be
able to locate the parts of a system responsible
for recoverability. The size of these parts might
indicate a higher recoverability.
Recoverability might increase if the unweighted WMC increases.
- Efficiency 2.5
-
might decline with increasing WMC.
- Time Behavior 2.5.1:
-
Static size might indicate a higher execution
time due to increased number of instruction cache
misses, long jumps, etc.
Time behavior might get worse with increasing unweighted WMC.
- Resource Utilization 2.5.2:
-
Static size might indicate a higher memory
utilization.
Resource utilization might get worse if the unweighted WMC increases.
- Maintainability 2.6
- declines with increasing WMC.
- References
- Since
- Compendium 1.0
Next: Response For a Class Up: Structural Complexity Previous: McCabe Cyclomatic Complexity (