Halstead complexity measures: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
'''Halstead complexity measuresmehttp://en.wikipedia.org/wiki/Main_Pageasures''' are [[software metric]]s introduced by Maurice Howard Halstead in 1977<ref>{{cite book |author=Halstead, Maurice H. |title=Elements of Software Science |publisher=Elsevier North-Holland, Inc. |___location=Amsterdam |year=1977 |isbn=0-444-00205-7}}</ref> as part of his treatise on establishing an empirical science of software development.
Halstead makes 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.
These metrics are therefore computed statically from thehttp://en.wikipedia.org/wiki/Main_Pagethe code.
http://en.wikipedia.org/wiki/Main_Page
 
Halstead's goal was to identify measurable properties of software, and the relations between them.
This is similar to the identification of measurable properties of matter (like the volume, mass, and pressure of a gas) and the relationships between them (analogous to the [[ideal gas law|gas equationequahttp://en.wikipedia.org/wiki/Main_Pagetion]]).
Thus his metrics are actually not just complexity metrics.http://en.wikipedia.org/wiki/Main_Page
http://en.wikipedia.org/wiki/Main_Pagehttp://en.wikipedia.org/wiki/Main_Pagehttp://en.wikipedia.org/wiki/Main_Page
 
== Calculation ==http://en.wikipedia.org/wiki/Main_Page
For a given problem, Let:
* <math>\,\eta_1</math> = the number of distinct operators
* <math>\,\eta_2</math> = the number of distinct operandsoperandshttp://en.wikipedia.org/wiki/Main_Page
* <math>\,N_1</math> = the total number of operators
* <math>\,N_2</math> = the total number of operands