32
Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics Dealing with Uncertainties (Chapters 19-20)

Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Embed Size (px)

DESCRIPTION

TPS Decision Problem 7 OS Development Options: Option B-Conservative (BC) –Sure to work (cost=$600K) –Performance = 4000 tr/sec Option B-Bold (BB) –If successful,Cost=$600K Perf.= 4667 tr/sec –If not,Cost=$100K Perf.= 4000 tr/sec Which option should we choose? 3

Citation preview

Page 1: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Fundamentals of Software Engineering Economics (IV)

1

LiGuo HuangComputer Science and Engineering

Southern Methodist University

Software Engineering EconomicsDealing with Uncertainties

(Chapters 19-20)

Page 2: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Dealing With Uncertainties

• TPS Example: Uncertain outcome• Decision rules for complete uncertainty• Utility functions• Expected value of perfect information• Statistical decision theory• The value-of-information procedure

2

Page 3: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

TPS Decision Problem 7OS Development Options:• Option B-Conservative (BC)– Sure to work (cost=$600K)– Performance = 4000 tr/sec

• Option B-Bold (BB)– If successful, Cost=$600K

Perf.= 4667 tr/sec– If not, Cost=$100K

Perf.= 4000 tr/secWhich option should we choose?

3

Page 4: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Operating System Development Options

Option BB (Bold)Successful Not

SuccessfulOption BC

(Conservative)Option A

Performance (tr/sec) 4667 4000 4000 2400Value ($0.3K per tr/sec) 1400 1200 1200 720 Basic cost 600 600 600 170 Total cost 600 700 600 170 Net value NV 800 500 600 550NV relative to Option A 250 -50 50 0

4

Page 5: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Decision-making under Complete Uncertainty

• The outcome or payoff depends on which of several states of nature may hold.

• Given any state of nature, the payoff for each alternative is known.

• The probability that any given state of nature holds is unknown.

5

Page 6: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Payoff Matrix for OS Options BB, BC

State of Nature

Alternative Favorable Unfavorable

BB (Bold) 250 -50

BC (Conservative)

50 50

6

Page 7: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Decision Rules for Complete Uncertainty (1)

• Maximin Rule. Determine minimum payoff for each option. Choose option maximizing the minimum payoff. (Most Pessimistic)

7

Alternative Favorable UnfavorableBB 1,000,000 -50BC 50 50

Page 8: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Decision Rules for Complete Uncertainty (2)

• Maximax Rule. Determine max-payoff for each option. Choose option maximizing max-payoff. (Most optimistic)

8

Alternative Favorable UnfavorableBB 51 -1,000,000BC 50 50

Page 9: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Decision Rules for Complete Uncertainty (3)

• Laplace Rule. Assume all states of nature equally likely. Choose option with maximum expected value.

BB = 0.5(250) + 0.5(-50) = 100 BC = 0.5(50) + 0.5(50) = 50

9

Page 10: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Difficulty with Laplace Rule

Favorable U1 U2 Expected Value

BB 250 -50 -50 50

BC 50 50 50 50

U1 : performance failureU2 : reliability failure

10

Page 11: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Breakeven Analysis• Treat uncertainty as a parameter

P= Prob (Nature is favorable)• Compute expected values as f(P)

EV (BB) = P(250) + (1-P)(-50) = -50 + 300PEV (BC) = P(50) + (1-P)(50) = 50

• Determine breakeven point P such thatEV (BB) = EV (BC): -50 + 300P = 50, P=0.333

If we feel that actually P>0.333, Choose BB P<0.333, Choose BC

11

Page 12: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Utility Functions

Is a Guaranteed $50K

The same as

A 1/3 chance for $250K

and A 2/3 chance for -$50K?

12

Page 13: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Utility Function for Two Groups of ManagersUtility

1 2 3 4 5-1-2-3

10

20

-10

-20

Payoff ($M)

Group 1

Group 2

13

Page 14: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Possible TPS Utility Function

10

20

-10

-20

-100 100 200 300

(-80,-25)

(-50,-20)

(50,5) (100,10)(170,15)

(250,20)

14

Utility

Payoff ($M)

Page 15: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Utility Functions in S/W Engineering

• Managers prefer loss-aversion– EV-approach unrealistic with losses

• Managers’ U.F.’S linear for positive payoffs– Can use EV-approach then

• People’s U.F.’S aren’t– Identical– Easy to predict– Constant

15

Page 16: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

TPS Decision Problem 8

•Available decision rules inadequate

•Need better information

Info. has economic value

AlternativeState of Nature

Favorable Unfavorable

BB (Bold) 250 -50BC (Conservative) 50 50

16

Page 17: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Expected Value of Perfect Information (EVPI)

Build a Prototype for $10K– If prototype succeeds, choose BB

Payoff: $250K – 10K = $240K– If prototype fails, choose BC

Payoff: $50K – 10K = $40KIf equally likely,

EV = 0.5 ($240K) + 0.5 ($40K) = $140K

Could invest up to $50K and do better than before – thus, EVPI = $50K

17

Page 18: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

However, Prototype Will Give Imperfect Information

That is,P(IB|SF) = 0.0

Investigation (Prototype) says choose bold state of nature: Bold will fail

P(IB|SS) = 1.0Investigation (prototype) says choose bold

state of nature: bold will succeed

18

Page 19: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Suppose we assess the prototype’s imperfections asP(IB|SF) = 0.20, P(IB|SS) = 0.90

And Suppose the states of nature are equally likelyP(SF) = 0.50 P(SS) = 0.50

We would like to compute the expected value of using the prototypeEV(IB,IC) = P(IB) (Payoff if use bold)

+P(IC) (Payoff if use conservative)= P(IB) [ P(SS|IB) ($250K) + P(SF|IB) (-$50K) ] + P(IC) ($50K)

But these aren’t the probabilities we know19

Page 20: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

How to get the probabilities we need

P(IB) = P(IB|SS) P(SS) + P(IB|SF) P(SF)

P(IC) = 1 – P(IB)

P(SS|IB) = P(IB|SS) P(SS) (Bayes’ formula) P(IB)

P(SF|IB) = 1 – P (SS|IB)

P(SS|IB) = Prob (we will choose Bold in a state of nature where it will succeed) Prob (we will choose Bold)

20

Page 21: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Net Expected Value of PrototypePROTO

COST, $KP (IB|SF) P (IB|SS) EV, $K NET EV,

$K0 60 05 0.30 0.80 69.3 4.310 0.20 0.90 78.2 8.220 0.10 0.95 86.8 6.830 0.00 1.00 90 0

8

4

010 20 30

NET

EV,

$K

PROTO COST, $K 21

Page 22: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Discussion: Expected Value of Perfect Information (EVPI) (1)

Given a choice between m alternatives: A1, A2, …, Am

• n possible states of nature: S1, S2, …, Sn

• probability of occurrence P(S1), P(S2), …, P(Sn)• payoff value of choosing Ai in state of nature Sj

22

S1 S2 … Sn

A1 V11 V12 … V1n

A2 V21 V22 … V2n

.

.

.

.

.

.

.

.

.

. . .

.

.

.

Am Vm1 Vm2 … Vmn

Page 23: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Discussion: Expected Value of Perfect Information (EVPI) (2)

• Use subjective probability approach to compute the expected value of choosing each alternative Ai

• If we have no information, pick the alternative providing the maximum expected value

• If we have perfect information on which state of nature will occur,

23

inniii VSPVSPVSPAEV )(...)()()( 2211

])(...)()([max)( 2211,...,1inf inniimiono VSPVSPVSPEV

inminimioperfect VSPVSPEV )max)((...)max)(()(,...,11,...,11inf

Page 24: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Discussion: Expected Value of Perfect Information (EVPI) (3)

• The expected value of acquiring the perfect information (EVPI) :

24

n

jijjmi

n

jijmij

onooperfect

VSPVSP

EVEVEVPI

1,...,11 ,...,1

infinf

)(max)max)((

)()(

• Example

Page 25: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Discussion: Expected Value of Imperfect Information

25

, for j = 1, …, n1)|(1

j

m

ii SIAP

n

jijij

m

ii

i

m

iim

VIASPIAP

IAgupayoffEVIAPIAIAEV

11

11

])|([)(

)sin()(),...,(

)()|()(1

jj

n

jii SPSIAPIAP

)()()|(

)|(i

jjiij IAP

SPSIAPIASP Bayes’s formula:

Page 26: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Value-of-Information Procedure1. Formulate a set of alternative IS development approaches A1, A2, …, Am

2. Determine the states of nature S1, S2, …, Sn

3. Determine the values Vij in the payoff matrix4. Determine the probability P(Sj)5. Compute (EV)no info, (EV)perfect info, and EVPI6. If EVPI is negligible, choose the approach Ai which provides the best (EV)no

info

7. If EVPI is not negligible, it provides a rough upper bound for the investigation effort.

8. For each type of investigation, estimate P(IAi|Sj)9. Compute the expected value of information provided by investigation K,

EV(Ik)10. Compute the net value of each investigation NV(Ik)= EV(Ik)-Ck

26

Page 27: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Value-of-Information Procedure (Cont.)

Considering choosing a preferred investigation approach:•The relative net values of investigations•Whether or not any of the net values are positive•Whether the results of the investigation will be available in time•The relative magnitude of side benefits of the investigations

27

Page 28: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Using Value-of-Information Procedure in Software Engineering

1. How much should we invest in feasibility studies before committing to a particular concept for development?

2. How much should we invest in COTS product analysis?

3. How much should we invest in risk analysis?4. How much should we invest in V&V?

28

How much should we invest in further information gathering and analysis investigations before committing ourselves to a Course of action?

Page 29: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Conditions for Successful Prototyping (or Other Info-Buying)

1. There exist alternatives whose payoffs vary greatly depending on some states of nature.

2. The critical states of nature have an appreciable probability of occurring.

3. The prototype has a high probability of accurately identifying the critical states of nature.

4. The required cost and schedule of the prototype does not overly curtail its net value.

5. There exist significant side benefits derived from building the prototype.

29

Page 30: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Pitfalls Associated by Success Conditions

1. Always build a prototype or simulation– May not satisfy conditions 3,4

2. Always build the software twice– May not satisfy conditions 1,2

3. Build the software purely top-down– May not satisfy conditions 1,2

4. Prove every piece of code correct– May not satisfy conditions 1,2,4

5. Nominal-case testing is sufficient– May need off-nominal testing to satisfy conditions

1,2,3

30

Page 31: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

Statistical Decision Theory: Other S/W Engineering Applications

How much should we invest in:– User information gathering– Make-or-buy information– Simulation– Testing– Program verification

How much should our customers invest in:– MIS, query systems, traffic models, CAD,

automatic test equipment, …

31

Page 32: Fundamentals of Software Engineering Economics (IV) 1 LiGuo Huang Computer Science and Engineering Southern Methodist University Software Engineering Economics

The Software Engineering Field Exists Because

Processed Information Has Value

32