Each product of software development is a physical entity; as such, it can be described in terms of its size. Ideally, we want to define a set of attributes for software size analogous to human height and weight. That is we want them to be fundamental, so that each attribute captures a key aspect of software size. We suggest the following:When measuring length and functionality it is sometimes important to observe reuse.
- length: physical size of the product
- functionality: functions supplied by the product to the user
- complexity
- problem complexity: the complexity of the underlying problem
- algorithmic complexity: efficiency of the algorithm
- structural complexity: algorithm structure (Chapter 8)
- cognitive complexity: understandability of software (not treated here)
We must address how the following is handled:It is useful to separate comment lines and other lines (NCLOC), so that
- blank lines
- comment lines (CLOC)
- data declarations
- lines that contains several separate instructions
total length (LOC) = NCLOC + CLOC. The entity CLOC/LOC is then a measure of the density of comments in a program.
The problem in counting lines of code is illustrated in Figure 7.1 and Table 7.2.