ITWissen.info - Tech know how online

Halstead

For the measurement of software products so-called software metrics are used, which quantify different characteristics of software products and processes. The software metric presented 1977 of Halstead is to be assigned to the group of the extent metrics and defines characteristic values for the program volume, the difficulty of understanding a program, the programming expenditure as well as the number of the programming errors which can be expected. Disadvantage with this nevertheless complex procedure is that the strongly different characteristics of a program are simplified and the source code as central object of the measurement are overemphasized.

Basis for the metric of Halstead

The metric of Halstead is based on the assumption that a program consists only of operands and operators. Here, an operator is any symbol or keyword that entails an action, e.g., arithmetic operators, keywords such as while or for, and special symbols such as := or parentheses. Operands are all symbols that represent data (variables, constants, jump labels). The classification of operands and operators was not clearly defined by Halstead. The metric is based on the following basic variables:

n1, n2 ... Number of different operators and operands,

N1, N2 ... Total number of operators and operands,

N = n1 + n2 ... Number of different symbols,

N = N1 + N2 ... Total number of all symbols.

Halstead has now defined the following measures:

Program volume: V = N x ldn

Assuming an equal distribution of words, this relation formulates the length of a sentence under optimal binary coding. This results again from realizations of the information theory. By investigations it could be proven that the characteristic quantities for operators, program length and program volume are in close correlation (similarity) and supply a good estimate for the module size.

Difficulty: S = (n1 x N2)/(2 x n2)

Where S describes the effort required to implementalgorithms, understand program code, and the effort required to read code during code review.

Programming effort: E = V/S

This characterizes the programming effort as a function of the volume V and the degree of difficulty S. The interesting aspect of this is that the measure of E is elementary thinking steps. Halstead based this consideration on a study by the psychologist Stroud, according to which the brain performs between 5 and 18 elementary operations per second. Thus, measures can be transformed into temporal statements. In subsequent experiments, the strong correlation between the calculated programming effort E and the actual effort to create a software - based on man-days and man-months - was then also established.

Programming error: Beta = V/3000

This formalism is based on the realization won in experiments of Halstead that on the average after 3000 elementary operations of the brain a programming error occurs.

With summarizing and critical view of the software metric of Halstead the following can be stated:

  • When determining the parameters, only a section of the development process is considered - the conversion of the design into the source code. The approach leaves many causes of complexity such as the nesting depth or the validity range ofnames unconsidered.
  • Ambiguities in the approach, especially in the ambiguous classification of operands and operators, can greatly affect the result.
  • Advantageously is that the measure determined after Halstead correlates strongly with the frequency of programming errors (correlation = similarity).
  • The procedure is to be used independently of a programming language.

Informations:
Englisch: Halstead
Updated at: 31.10.2013
#Words: 544
Links: measurement, software (SW), software metric, program, procedure
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024