Halstead complexity measures: Difference between revisions

Content deleted Content added
Dfg13 (talk | contribs)
improve formatting of equations; use eta instead of n as in original book
Dfg13 (talk | contribs)
make equation formatting uniform
Line 9:
== Calculation ==
First we need to compute the following numbers, given the program:
* <math>\,\eta_1</math> = the number of distinct operators
* <math>\,\eta_2</math> = the number of distinct operands
* <math>\,N_1</math> = the total number of operators
* <math>\,N_2</math> = the total number of operands
 
From these numbers, five measures can be calculated:
* Program length: <math>N = N_1 + N_2 \,</math>
* Program vocabulary: <math>\eta = \eta_1 + \eta_2 \,</math>
* Volume: <math>V = N \times \log_2 \eta </math>
* Difficulty : <math>D = { \eta_1 \over 2 } \times { N_2 \over \eta_2 } </math>