Metrics for size --
LOC or KLOC
* Jalote notes a standard definition is to count
non-comment, non-blank lines
generally, only new or modified lines are counted
Halstead's Volume
* what if you looked at the number of
OPERATORS and the number of OPERANDS
n1 - number of distinct operators
n2 - number of distinct operands
N1 - total number of operators
N2 - total number of operands
Vocabulary n of a program: n = n1 + n2
Length: N = N1 + N2
Volume: V = Nlog2(n)
*****
WHAT ABOUT METRICS for COMPLEXITY??
****
* Cyclomatic Complexity - widely used...? Jalote says
* represent a program as a control flow graph
* NOTE missing edge in text's example! (between
nodes e and b)
* also see, posted with these notes, how I think
this is working
* Cyclomatic complexity
V(G) = e - n + p
it is the same as the number of linearly independent
cycles in the graph
it is the same as the number of DECISIONS in the program
minus one