# Software Measurement: A Necessary Scientific Basis

### From Maisqual Wiki

Norman Fenton

This page needs reviewing.

## Contents |

# Contents

- Introduction
- Measurement Fundamentals
- What is Measurement?
- Representational Theory of Measurement

- Measuring Software "Complexity"
- General Complexity Measures: The Impossible Holy Grail
- The Weyuker Properties

- Unifying Framework for Software Measurement
- A Classification of Software Measures
- Software Metrics Activities Within the Framework
- The Importance of Internal Attributes
- Validating Software Measures

- Summary

# Notes

Canthor's Theorem:

The empirical relation system $(C, b)$ has a representation in $(\Re, <)$ if and only if b is a strict weak order. The scale type is ordinal when such a representation exists.

The relation b being a strict weak order means that it is:

- asymmetric (xRy implies that it is not the case yRx), and
- negatively transitive (xRy implies that for every $z \in C$, either xRy or zRy).

## Measuring Software Complexity

## General Complexity Measures: The Impossible Holy Grail

There are many control-flow complexity measures^{[1]}. The following applies measure theory theorems to control-flow complexity measures.

Hypothesis 1: Let C be the class of programs. Then the attribute control-flow "complexity" is characterized by an empirical relation system which includes a binary relation b "less complex than"; specifically (x, y) \in b if there is a consensus that x is less complex than y.

Hypothesis 2: The proposed measure M:C \longrightarrow \Re is a representation of complexity in which the relation b is mapped to <.

As for the Mc Cabe complexity measure, given the following diagrams:

If people were asked to "rank" these for complexity (since a common consensus would be enough to accept the clause of negative transitivity) they would inevitably end up asking questions like "what is meant by complexity" before attempting to answer.

If for example $M(z) < M(y)$ (as in the case of McCabe's complexity measure in the above figure where M(z) = 2 and M(y) = 3) then, if M is really a measure of complexity, the Representation Condition asserts that we must also have z < y for which there is no consensus.

Theorem 1: Assuming Hypothesis 1, there is no general notion of control-flow complexity of programs which can be measured on an ordinal scale in $(\Re, <)$.

However, measures that characterize specific views of complexity, which is the true measurement theory approach, are not ruled out by this theorem.

# See also

# References

- ↑ J. Tian and M.V. Zelkowitz, "A formal program complexity model and its applications", J. Syst. Software, vol. 17, pp. 253-266, 1992.