Here are some metrics that many DoD contractors utilize...
Cyclomatic Complexity (v(G)) is a measure of the complexity of a module's decision structure. It is the number of linearly independent paths and therefore, the minimum number of paths that should be tested. Cyclomatic complexity is an indicator of reliability. Larger values (e.g., greater than a range of 10-20) have correlated with increased defects and with increased defect insertion probability.
Do you know what your Cyclomatic Complexity is? McCabe IQ does.
Weighted Methods per Class (WMC)
WMC is the number of locally implemented methods. Larger values (e.g., 14 or greater) indicate lesser polymorphism. The larger the number of methods in a class the greater the potential impact on children, since children will inherit all the methods defined in the class. Classes with large numbers of methods are likely to be more application specific, limiting the possibility of reuse.
Do you know what your WMC is? McCabe IQ does.
Response For Class (RFC)
RFC is the number of methods in the set of all methods that can be invoked in response to a message sent to an object of a class. Larger values (e.g., 40 or greater) indicate lesser polymorphism. If a large number of methods can be invoked in response to a message, the testing and debugging of the class becomes more complicated since it requires a greater level of understanding on the part of the tester. The larger the number of methods that can be invoked from a class, the greater the complexity of the class. A worst case value for possible responses will assist in appropriate allocation of testing time.
Do you know what your RFC is? McCabe IQ does.
Lack of Cohesion of Methods (LOCM)
LOCM is the average across all fields (i.e., instance variables) of a class of the percentage of the class' methods that use that field, with the result subtracted from 100%. Larger values (e.g., 75% or greater) indicate lesser cohesion. Lack of cohesion implies classes should probably be split into two or more subclasses. Any measure of disparateness of methods helps identify flaws in the design of classes. Low cohesion increases complexity, thereby increasing the likelihood of errors during the development process.
Do you know what your LOCM is? McCabe IQ does.
Coupling Between Objects (CBO)
CBO is the number of classes to which a class is coupled. Coupling is defined as : Two classes are coupled when methods declared in one class use methods or instance variables of the other class. Larger values (e.g., 2 or greater) indicate greater coupling. Excessive coupling between object classes is detrimental to modular design and prevents reuse. The more independent a class is, the easier it is to reuse it in another application. In order to improve modularity and promote encapsulation, inter-object class couples should be kept to a minimum. The larger the number of couples, the higher the sensitivity to changes in other parts of the design, and therefore maintenance is more difficult. A measure of coupling is useful to determine how complex the testing of various parts of a design are likely to be. The higher the inter-object class coupling, the more rigorous the testing needs to be.
Do you know what your CBO is? McCabe IQ does.
McCabe Software puts our 30 years of software quality management expertise into McCabe IQ. Our past is the key to better systems.
Fill out the form to the right to schedule a demonstration and gain access to our document library.