Information Technology Reference
In-Depth Information
η 2 * is the small-
est number of operands required for the minimal implementation, which Halstead
stated are the required input and output parameters.
V * is the smallest possible implementation of an algorithm, where
V /
Program level ( L )as L
=
V
(5.10)
Program level measures the program's ability to be comprehended. The closer
L is to 1, the tighter the implementation. Starting with the assumption that code
complexity increases as vocabulary and length increase, Halstead observed that the
code complexity increases as volume increases and that code complexity increases
as program level decreases. The idea is that if the team computes these variables and
finds that the program level is not close to 1, the code may be too complex. The team
should look for ways to “tighten” the code.
Halstead's work is sweeping, covering topics such as computing the optimal
number of modules, predicting program errors, and computing the amount of time
required for a programmer to implement an algorithm.
Halstead Metrics
Program Volume: The minimum number of bits required for coding the program.
Program Length: The total number of operator occurrences and the total number
of operand occurrences.
Program Level and Program Difficulty: Measure the program's ability to be
comprehended.
Intelligent Content: Shows the complexity of a given algorithm independent of
the language used to express the algorithm.
Programming Effort: The estimated mental effort required to develop the pro-
gram.
Error Estimate: Calculates the number of errors in a program.
Programming Time: The estimated amount of time to implement an algorithm.
Line Count Software Metrics
Lines of Code
Lines of Comment
Lines of Mixed Code and Comments
Lines Left Blank
A difficulty with the Halstead metrics is that they are hard to compute. How does
the team easily count the distinct and total operators and operands in a program?
Imagine counting these quantities every time the team makes a significant change to
a program.
Code-level complexity measures have met with mixed success. Although their
assumptions have an intuitively sound basis, they are not that good at predicting error
Search WWH ::




Custom Search