Software Metrics and Software Metrology

Software Metrics and Software Metrology
Alain Abran
IEEE Computer Society, 2010
ISBN 978-0-470-59720-0

Chapitre 1: Introduction
Chapitre 2: From Measurement Methods to Quantitative Models
Chapitre 3: Metrology and Quatity Criteria in Software Measurement
Chapitre 4: Quantification and Measurement are not the same
Chapitre 5: Design of Software Measurement Methods
Chapitre 6: Cyclomatic Complexity
Chapitre 7: Halstead's Metrics
Chapitre 8: Function Points
Chapitre 9: Use Case Points
Chapitre 10: ISO 9126
Chapitre 11: COSMIC: Design
Chapitre 12: COSMIC: Industrialization
Chapitre 13: Convertibility across measurements methods
Chapitre 14: Design of Standard Etalons

Some definitions

[page 35] Verification or Validation?
[page 114] et [page 168] Scale Type and Mathematical Structure

Scale TypeDescriptionExamplesOperations allowedMisuse
Nominalused to name objects or events; used only in identifying requirements.Telephone Area Code (514-Montreal, 418-Quebec City, etc)==, !=514 is higher than 418
Ordinalused to put objects in order, criterion may be subjective (preferably objective)..Frequentness (0=very rare, 1=rare, 2=medium, 3=frequent, etc.)nominal operations and,
<, >
'2' is twice as frequent as '1'
Interval (also called cardinal)used to determine difference between ranks.Temperature in Celcius, calendar timeordinal operations and,
+, -, average
+10C is twice warmer than +5C
Ratiohas an absolute zero that is not arbritary; significant to multiply by a non-negative number. Temperature in Kelvin, mass, distance.interval operations and,
*, /, percentage,
log(1 meter) = 0
log (3 feets) ~= 1.1
meters (or feets) are arbitrary echelons.
Absolutehas a significant unit measure (echelon) that is not arbritary, significant to count entities.Entity count.ratio operations and,

[page 141] Software Complexity

[page 152] The measurement unit produced by log2

In general, in engineering applications, we do not take the logarithm of a dimensioned number, only that of a dimensionless quantity. For instance, in calculating decibels, we take the logarithms of a ratio of two quantities.  A ratio of quantities with the same dimensions is itself dimensuionless. We can write:
log(a/b) = log(a) - log(b)

making it appear that we are taking the logs of dimentioned quantities (a) and (b), but the dimensions "come out in the wash" : by the time we have finished (substracting one log from the other), we have effectively taken the log of a dimentionless quantity (a/b).

We can regard units as factors in an expression, for instance:
8 meters = 8 * 1 meter
800 cm  = 800 * 1 cm
              = 800 * 0.01 * 1 meter


The inconvenient term 8*log2(1m) is an additive term that depends on the units being used.  If it is part of a valid engineering calculation, it will be canceled out somewhere in the process.  It may be, for instance, that when we take the log of 8 meters, we are actually taking the log of a ratio of 8 meters to a one-meter standard length.

[page 162] Two kinds of software size:
[Personal Note] : I would add computational size, from a machine's perpective: size in memory, size on disk, % of CPU.
[page 232] A real-time system:

Some metrics and equations 

Cyclomatic complexity

v(G) = e - n + p
e : nb edges
n : nb vertices
p: separate components

Halstead's metrics

Base measures:
N1 : Total nb of occurrences of operators
N2 : Total nb of occurrences of operarands
n1 : Nb of distinct operators
n2 : Nb of distinct operands
n1* : Nb of potential operators (minimum possible number of operators for a module)
n2* : Nb of potential operands

N = N1  + N2
N : length of a program P

n = n1  + n2
n : vocabulary

V = N * log2 n
V : volume of a program P

V* = (2 + n2)  log2 (2 + n2)
V* : potential (minimal) volume of a program P

L = V* / V
L : program level

D = (n1 / 2) * (N / n2)
D : program difficulty

E = V / L according [Abran], V * D according others
E : programming effort

T = E / S
T : programming time in seconds
S : the Stroud number, i.e. the number of mental discrimination per second, in the range of 5 to 20.  S is set to 18 for software scientists.

ISO standards mentionned in the book:

Some errors or typos:

Some doubtful conclusions:

Dernière mise à jour: 26 novembre 2010.