Download presentation
Presentation is loading. Please wait.
Published byBlake Lawrence Modified over 9 years ago
1
Measurement - part 2 1 Software Measurement Measurement Theory
2
Measurement - part 2 2 Measurement Theory u circa 1900 - applied to physics u 1940’s - applied to psychology, sociology u 1990’s - applied to software measurement
3
Measurement - part 2 3 Representational TOM u empirical relation system –(C,R) u numerical relation system –(N,P) u M maps (C,R) to (N,P) u representation condition –x M(x)<M(y)
4
Measurement - part 2 4 Empirical u A set of entities, E u A set of relationships, R –often “less than” or “less than or equal” –note that not everything has to be related
5
Measurement - part 2 5 Numerical u A set of entities –also called the “answer set” –usually numbers - natural numbers, integers or reals u A set of relations –usually already exists –often “less than” or “less than or equal”
6
Measurement - part 2 6 The Mapping u The representation condition –M(x) rel M(y) if x rel y –x rel y iff M(x) rel M(y) u Both have been used by classical measurement theory authors u I prefer the first definition
7
Measurement - part 2 7 “BIG” example u We want to measure people as BIG –i.e. height and weight u Empirically, if two people are the same height, the heavier is bigger –if two people are the same weight, the taller is bigger u Answer set is real or tuple?
8
Measurement - part 2 8 Classic Example u McCabe’s Cyclomatic Number u Empirical - Control Flow Graph u Numerical (Answer Set) - integers u mapping - E-N+2
9
Measurement - part 2 9 Empirical u How can we rank McCabe’s? u What is the relationship? u What is a partial order?
10
Measurement - part 2 10 Creating a New Theory Why should a theory devised for physical phenomenon be useful for software - an artificial phenomenon?
11
Measurement - part 2 11 Empirical Relations u One cludge that appears very often in the computer science literature is to define the empirical relation as that which makes the representation condition hold for the measure u The truth is that we do not have centuries of consensus on the empirical relationships
12
Measurement - part 2 12 Artificial u Software has been described as an artificial science because we control the objects. In fact, the objects are artifacts - made by humans u However, if there are constraints on these artifacts, it is usually in the operations that can change the artifacts
13
Measurement - part 2 13 Transformations u Consider the transformations that you can do to a syntactically correct program that maintains the correctness: – add a statement – add a condition – remove a statement
14
Measurement - part 2 14 MOM u Model - Order - Mapping u the model is the abstraction u the order is an ordering on the abstraction –can be partial, can be constructive u the mapping is from the model to the answer set –must preserve the order (I.e. rep condition)
15
Measurement - part 2 15 MOM
16
Measurement - part 2 16 Triangle Problem cin>>a>>b>>c; type=“scalene”; if (a==b||b==c||a==c) type=“isosceles”; if (a==b&&b==c) type=“equilateral”; if (a>=b+c||b>=a+c||c>=a+b) type=“not a triangle”; if (a<=0||b<=0||c<=0) type=“bad inputs”; cout<<type;
17
Measurement - part 2 17 Triangle CFG 1,2,3a 3b 4a 4b 5a 5b 6a 6b 7
18
Measurement - part 2 18 Formal Spec u CFG is described by set of nodes {1,3b,4a,4b,5a,5b,6a,6b,7} and set of arcs {(1,3b),(1,4a),(3b,4a),(4a,4b),(4a,5a), (4b,5a), (5a,5b),(5a,6a),(5b,6a),(6a,6b), (6a,7),(6b,7)
19
Measurement - part 2 19 Partial Order u Originally, for all cfg x,y, x <=y if and only if all nodes and edges in x are also in y. u Thus adding an edge to x made a new cfg y such that x <= y but y may not be a cfg for a valid program u Constructive definition - x <= y if there is a set of transforms (additive) such that the transforms are applied to x produce y
20
Measurement - part 2 20 Representation Condition u Can prove that for all cfg’s x and y, if x<=y then m(x) <= m(y) u Note that this is not the iff rep condition. Since the partial orders on the abstractions are partial, if can only be one way
21
Measurement - part 2 21 Proof of monotonicity u Can show that no additive transform can decrease the cfg or the value of the mapping u Can show that additive transforms of adding if-then, if-then-else, while will always result in an increase of 1 in the value of the mapping
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.