Halstead complexity measures: Difference between revisions

Content deleted Content added
No edit summary
Number of Operator count(n1) was wrong and hence calculation becomes wrong further.
Line 46:
The unique operators are:
<tt>main</tt>, <tt>()</tt>, <tt>{}</tt>, <tt>int</tt>, <tt>scanf</tt>,
<tt>&</tt>, <tt>=</tt>, <tt>+</tt>, <tt>/</tt>, <tt>printf,',', ;</tt>
The unique operands are:
<tt>a</tt>, <tt>b</tt>, <tt>c</tt>, <tt>avg</tt>, <tt>"%d %d %d"</tt>, <tt>3</tt>, <tt>"avg = %d"</tt>
* <math>\eta_1 = 1012</math>, <math>\eta_2 = 7</math>, <math>\eta = 1719</math>
* <math>N_1 = 1627</math>, <math>N_2 = 15</math>, <math>N = 3142</math>
* Calculated Program Length: <math>\hat{N} = 1012 \times log_2 1012 + 7 \times log_2 7 = 5262.967</math>
* Volume: <math>V = 3142 \times log_2 1719 = 126178.74</math>
* Difficulty: <math>D = { 1012 \over 2 } \times { 15 \over 7 } = 1012.785</math>
* Effort: <math>E = 1012.785 \times 126178.74 = 13552292.744</math>
* Time required to program: <math>T = { 1,3552292.744 \over 18 } = 75127.4357</math> seconds
* Number of delivered bugs: <math>B = { 1,3552292.744 ^ { 2 \over 3 } \over 3000 } = 0.0405</math>
 
== See also ==