img
Question:
Published on: 21 November, 2024

What are Halstead’s metrics?

Answer:

Halstead’s metrics:

Halstead metrices introduced by Maurice Howard Halstead in 1977  is an analytical technique to measure size, development efforts and development cost of software products. Halstead used a few primitive program parameters to develop the expression for over all program length, potential minimum volume,actual volume, language level, effort and development time.Halstead made the observation that metrics of the software should reflect the implementation or expression of algorithms in different languages, but be independent of their execution on a specific platform. Halstead's goal was to identify measurable properties of software, and the relations between them.

For a given problem, Let:

  • η1= the number of distinct operators
  • η2 = the number of distinct operands
  • N1 = the total number of operators
  • N2 = the total number of operands

From these numbers, several measures can be calculated:

  • Program vocabulary:  η= η1+ η2
  • Program length:  N=N1+N2
  • Calculated program length: Ň= η1log η1+ η2logη2
  • Volume:  ηV=Nxlog η
  • Difficulty : D= η1/2 xN2/ η2

 

  • Effort: E=DxV

 

Random questions