Halstead complexity measures

This is an old revision of this page, as edited by Sohale (talk | contribs) at 16:03, 27 November 2007 (fixing spaces). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
  • = the number of distinct operators
  • = the number of distinct operands
  • = the total number of operators
  • = the total number of operands


From these numbers, five measures are derived:

  • Program length:
  • Program vocabulary:
  • Volume:
  • Difficulty :
  • Effort:


  • Number of the used different operators (() and operand (), ), together the vocabulary size .
  • Number of the altogether used operators () and operand (), together the implementation length .

From this then the sizes of Halstead length become () and Healstead volume () are calculated:

From the base quantities one can compute different characteristic numbers, e.g.:

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 [1] and the German wikipedia entry.

see also