Halstead’s theory of “software science” [Hal77] proposed the first analytical “laws” for computer software. 14Halstead assigned quantitative laws to the development of computer software, using a set of primitive measures that may be derived after code is generated or estimated once design is complete. The measures are :
n1 = number of distinct operators that appear in a program
n2 = number of distinct operands that appear in a program
N1 = total number of operator occurrences
N2 = total number of operand occurrences
Halstead uses these primitive measures to develop expressions for the overall program length, potential minimum volume for an algorithm, the actual volume(number of bits required to specify a program), the program level (a measure of software complexity), the language level(a constant for a given language), and other features such as development effort, development time, and even the projected number of faults in the software,
Halstead shows that length N can be estimated
N=n1 log2 n1 + n2 log2 n2
and program volume may be defined
V= N log2 (n1+n2)
It should be noted that V will vary with programming language and represents the volume of information (in bits) required to specify a program
Theoretically, a minimum volume must exist for a particular algorithm Halstead defines a volume ratio L as the ratio of volume of the most compact form of a program to the volume of the actual program. In actuality, L must always be less than l. In terms of primitive measures, the volume ratio may be expressed as
L=2/n1 x n2/N2
Halstead’s work is amenable to experimental verification and a large body of research has been conducted to investigate software science. A discussion of this work is beyond the scope of this book. For further information, see[Zus90],[Fen91],and[Zus97].
Halstead’s theory of “software science” [Hal77] proposed the first analytical “laws” for computer software. 14Halstead assigned quantitative laws to the development of computer software, using a set of primitive measures that may be derived after code is generated or estimated once design is complete. The measures are :n1 = number of distinct operators that appear in a programn2 = number of distinct operands that appear in a programN1 = total number of operator occurrencesN2 = total number of operand occurrencesHalstead uses these primitive measures to develop expressions for the overall program length, potential minimum volume for an algorithm, the actual volume(number of bits required to specify a program), the program level (a measure of software complexity), the language level(a constant for a given language), and other features such as development effort, development time, and even the projected number of faults in the software,Halstead shows that length N can be estimatedN=n1 log2 n1 + n2 log2 n2and program volume may be definedV= N log2 (n1+n2)It should be noted that V will vary with programming language and represents the volume of information (in bits) required to specify a program Theoretically, a minimum volume must exist for a particular algorithm Halstead defines a volume ratio L as the ratio of volume of the most compact form of a program to the volume of the actual program. In actuality, L must always be less than l. In terms of primitive measures, the volume ratio may be expressed asL=2/n1 x n2/N2Halstead’s work is amenable to experimental verification and a large body of research has been conducted to investigate software science. A discussion of this work is beyond the scope of this book. For further information, see[Zus90],[Fen91],and[Zus97].
การแปล กรุณารอสักครู่..
![](//thimg.ilovetranslation.com/pic/loading_3.gif?v=b9814dd30c1d7c59_8619)