Halstead complexity measures: Difference between revisions

Content deleted Content added
translated from german(!) entry
m fixing spaces
Line 1:
* <math>n1</math> = the number of distinct operators
*<math>N2n2</math> = the total number of distinct operands
*<math>n2N1</math> = the total number of distinct operandsoperators
*<math>N1N2</math> = the total number of operatorsoperands
<math>N1</math> = the total number of operators
<math>N2</math> = the total number of operands
 
From these numbers, five measures are derived:
Program length:
<math>N= N1 + N2 </math>
 
*Program length: <math>N= N1 + N2 \,</math>
*Program vocabulary: <math>n= n1 + n2 \,</math>
*Volume: <math>nV= n1N +* n2(LOG2 n) \,</math>
*Difficulty : <math>D= (n1/2) * (N2/n2) \,</math>
*Effort: <math>E= D * V \,</math>
 
Volume:
<math>V= N * (LOG2 n) </math>
 
Difficulty :
<math>D= (n1/2) * (N2/n2) </math>
Effort:
<math>E= D * V </math>
 
* Number of the used different operators ((<math>n_1</math>) and operand (<math>n_2</math>), ), together the vocabulary size <math>n</math>.
 
* Number of the altogether used operators (<math>N_1</math>) and operand (<math>N_2</math>), together the implementation length <math>N</math>.
 
From this then the sizes of Halstead length become (<math>HL</math>) and Healstead volume (<math>HV=V</math>) calculatesare calculated:
 
* <math>HL = n_1 \times \log_2 n_1 - n_2 \times \log_2 n_2</math>
* <math>HV = N \times \log_2 n</math>
 
From the base quantities one can compute different characteristic numbers, e.g.:
 
* <math>D = { n_1 \over 2 } \times { N_2 \over n_2 }</math>
(Where D = difficulty of the program to write or understand, e.g. with one [[Code review]] (?) ).
 
 
 
From http://www.sei.cmu.edu/str/descriptions/halstead.html [http://www.sei.cmu.edu/str/descriptions/halstead.html] and the German wikipedia entry.
 
==see also==