





Testwell CMT++/CMTJava Complexity Measures Tools
Code Complexity / Software Complexity
Code complexity correlates with the defect rate and robustness of the application. Code which is to complex is often the reason for bad code quality and erroneous programs. Complex code is not only error prone, it is also difficult to test. Furthermore code complexity has effect on how difficult it is to maintain the program.As the costs of bad quality and erroneous programs can be very high, even crucial to a company, applications with a reasonable complexity helps you to save money.
Code complexity metrics are used to locate complex code. This metrics should be measured as early as possible in the developement process to allow the developers the adaptation of code when recommended values are exceeded.
Complexity Metrics are also used to control the quality of development projects which have been outsourced to other companies.
Lines of Code Metrics are the most traditional measures used to quantify software complexity. They do not, however, take into account the intelligence content and the layout of the code. Further Information
The Cyclomatic complexity of McCabe v(G) measures the number of linearly-independent paths through a program module (Control Flow). This metrics give also an indication about testing: each function should have at least as many test cases as indicated by its cyclomatic number. Further Information
Halstead metrics are based on the number of operators and operands in the source code:
- Number of unique (distinct) operators (n1)
- Number of unique (distinct) operands (n2)
- Total number of operators (N1)
- Total number of operands (N2)
- Estimated number of errors (B)
- Difficulty level, error proneness (D)
- Effort to implement (E)
- Program level (abstraction level of the program) (L)
- Program length (N)
- Implementation time / time to understand (T)
- Volume: size of the implementation of an algorithm (V)
Further Information
The Maintainability Index (MI) indicates when it becomes cheaper and/or less risky to rewrite the code instead to change it. Further Information
Tools:
Testwell CMT++ (for C and C++)
Testwell CMTJava (for Java)
Imagix 4D
CodeSonar
Documents:
Calculation of Software Metrics (currently only available in German and French)



