Metrics
Metrics
Quantification of Qualities
Issues and Approaches
Rushikesh K Joshi
Adapted from my Tutorial at SoDA Workshop, Jan 23, 2004, at Taj Westend, Bangalore
Measurement in day-to-day
activities
• What’s the temperature today?
• How much time did it take to travel?
• Was it a comfortable journey?
• Are you joking?
• How cold is it at Bangalore?
• How many participants in SoDA?
• Was the morning tea too sweet?
• How popular is soda amongst the students as
compared to tea?
• Which is the best team in the world?
Measurement
• Fundamental in any engineering discipline
• Software Engineering is no exception
• Quantification of Quality
– Quantification process is subjective
– Once quantified, the measure is objective
Some example uses of metrics
• Selecting Data structures and algorithms
• i.e. as in
– A is taller than B if and only if H(A) > H(B)
– A is tall if and only if H(A) > 70
– A is much taller than B if and only if H(A) > H(B)+15
Quantification
• Define following mappings from empirical to
numerical world
– A is taller than B if and only if H(A) > H(B)
– A is tall if and only if H(A) > 70
– A is much taller than B if and only if H(A) > H(B)
+15
• Now given
• sticks A,B,C and
• H(A)=84 H(B)=72 H(C )=42
We can say
– A is taller than B and H(A) > H(B) A B C
And so on
• The interpretation
Relevant relational properties
• Reflexive: • Asymmetric:
– aRa for all a’s in the – aRb not bRa
set • Antisymmetric:
• Irreflexive: – aRb and bRa
– not aRa for all a’s a=b
• Non-reflexive: • Transitive:
– It is not reflexive – aRb and bRc
aRc
• Symmetric:
– aRb bRa for all
a’s and b’s
Measurement scales
• Nominal
– Specs fault, design fault, coding fault
• Ordinal
– Trivial, simple, moderate, complex, incomprehensible
• Interval
– Temperature Celsius/Fahrenheit , relative time
• Ratio
– Length, weight, time intervals, temperature Kelvin
• Absolute
– counts
Nominal scale
• Empirical system consists of only different
classes
• There is no ordering among the classes
– Numbering of classes is okay
– but that is only to distinguish them and no notion of
magnitude is associate
• i.e. classes are not ordered, and even if they are numbered
from 1 to n, that is only for identification
• Civil engg students 001, cse students 002, Mech students
003
Ordinal Scale
• Empirical system consists of classes
• Classes are ordered with respect to the attribute
– Any mapping that preserves the ordering is
acceptable
– The number represents ranking only
– Hence no functions such as addition, subtraction
Then
• Viewpoints