metody statystyczne copyright, 2001 © jerzy r. nawrocki jerzy.nawrocki@put.poznan.plnawrocki/psp...

Post on 16-Jan-2016

221 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Metody statystyczneMetody statystyczne

Copyright, 2001 © Jerzy R. Nawrocki

Jerzy.Nawrocki@put.poznan.plJerzy.Nawrocki@put.poznan.pl

www.cs.put.poznan.pl/~nawrocki/pspwww.cs.put.poznan.pl/~nawrocki/psp

Doskonalenie Procesów Programowych Doskonalenie Procesów Programowych

Wykład 8Wykład 8

J. Nawrocki, DPP, Wykład 8

IntroductionIntroduction

.. Project planning .... Project planning ..

Size estimatingSize estimating

J. Nawrocki, DPP, Wykład 8

IntroductionIntroduction

Time & defect recordingTime & defect recording

Coding strd+Size measuremnt+PIPCoding strd+Size measuremnt+PIP

Size estimating + Test reportSize estimating + Test report

Task & schedule planningTask & schedule planning

Code & design reviewsCode & design reviews Design templates Design templates

Cyclic dev.Cyclic dev.

BaselineBaseline

PlanningPlanning

QualityQuality

CyclicCyclic

J. Nawrocki, DPP, Wykład 8

Plan of the lecturePlan of the lecture

• IntroductionIntroduction

• The Probe methodThe Probe method• ExampleExample• Effort estimationEffort estimation

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

Humphrey, CMU, 1995Humphrey, CMU, 1995

PROPROxy-xy-BBased ased EEstimatingstimating

Objects as proxies Objects as proxies

HistoricalHistorical

datadata

StatisticalStatistical

methodsmethods

ProbeProbemethodmethod

J. Nawrocki, DPP, Wykład 8

Planning a software projectPlanning a software project

Conceptual designConceptual designConceptual designConceptual design

Size estimates Size estimates Size estimates Size estimates

Resource estimates Resource estimates Resource estimates Resource estimates

The schedule The schedule The schedule The schedule

The product The product The product The product

RequirementsRequirementsRequirementsRequirements

Size databaseSize database

Productivity databaseProductivity database

Resources availableResources available

Size, res., sched. data

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

Conceptual designConceptual designConceptual designConceptual design

Calculate projected and modified LOCCalculate projected and modified LOCCalculate projected and modified LOCCalculate projected and modified LOC

Estimate program sizeEstimate program sizeEstimate program sizeEstimate program size

Calculate prediction intervalCalculate prediction intervalCalculate prediction intervalCalculate prediction interval

Identify objectsIdentify objects

Number of Object Relative Reuse Number of Object Relative Reuse

methods type size categoriesmethods type size categories

Identify objectsIdentify objects

Number of Object Relative Reuse Number of Object Relative Reuse

methods type size categoriesmethods type size categories

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

1. Prepare a conceptual 1. Prepare a conceptual design (objects and design (objects and methods + their methods + their function)function)

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

2. For each object 2. For each object assign its assign its typetype..

Skyscraper Church GarageSkyscraper Church Garage

• LogicLogic

• I/OI/O

• TextText

• CalculationCalculation

• DataData

• Set-upSet-up

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

3. For each object 3. For each object assign one of assign one of size size ranges.ranges.

Very big Big Medium Small Very smallVery big Big Medium Small Very small

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

4. Knowing:4. Knowing:• programming languageprogramming language• object typeobject type• size rangessize ranges• the number of methodsthe number of methods

estimate, using historical estimate, using historical data, size of each object.data, size of each object.

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

5. Determine initial 5. Determine initial program estimated program estimated size, X, adding the size, X, adding the values received in the values received in the previous step.previous step.

2 + 3 = 52 + 3 = 5

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

6. Apply linear 6. Apply linear regression to get regression to get estimated program estimated program size Y:size Y:

Y = Y = 11 X + X + 00

5 means 105 means 10

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

xxi i yyii - n x - n xavgavg y yavgavg

xxii22 - n x - n xavgavg

22 11 = =

00 = y = yavgavg - - 11 x xavgavg

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

7. Using the 7. Using the t distributiont distribution and and standard standard deviationdeviation compute the compute the prediction intervalprediction interval for for a given percentage. a given percentage.

For 100% theFor 100% the

interval isinterval is

[0; + [0; + ]]

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

7a. Calculate the standard deviation, 7a. Calculate the standard deviation, , of , of your historical data around the your historical data around the regression line.regression line.

1122 = (y = (yii - - 00 - - 11xxii))22 n-2n-2

i=1i=1

nn

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

7b. To find the two-sided value of 7b. To find the two-sided value of tt for the for the probability probability qq, look in a table of the , look in a table of the tt distribution under distribution under p(p()= (1+q)/2)= (1+q)/2 and and n-2n-2 degree of freedom.degree of freedom.

J. Nawrocki, DPP, Wykład 8

The t distributionThe t distribution

Degrees p()=.6 p()=.7 p()=.85 p()=.9

5 .267 .559 1.156 1.476

6 .265 .553 1.134 1.440

7 .263 .549 1.119 1.415

8 .262 .546 1.108 1.397

9 .261 .543 1.100 1.383

J. Nawrocki, DPP, Wykład 8

Probe methodProbe method

(X - x(X - xavgavg))22

(x(xii - x - xavgavg))22++

11

nn++11 Range = Range = tt

7c. Compute the range as follows:7c. Compute the range as follows:

Initial estimateInitial estimateobtained in Step 5obtained in Step 5

J. Nawrocki, DPP, Wykład 8

Plan of the lecturePlan of the lecture

• IntroductionIntroduction

• Probe methodProbe method

• ExampleExample

• Effort estimationEffort estimation

J. Nawrocki, DPP, Wykład 8

ExampleExample

Program to be modifiedProgram to be modified

MatrixMatrixMatrixMatrix LinearLinear

systemsystemLinearLinear

systemsystem

LinkedLinked

listlistLinkedLinked

listlist

Data Data entryentryData Data entryentry

Base programBase programBase programBase program

J. Nawrocki, DPP, Wykład 8

ExampleExample

Program to be modifiedProgram to be modified

MatrixMatrixMatrixMatrix LinearLinear

systemsystemLinearLinear

systemsystem

LinkedLinked

listlist

11

LinkedLinked

listlist

11

Data Data entryentryData Data entryentry

Base programBase programBase programBase program

LinkedLinked

listlist

22

LinkedLinked

listlist

22

J. Nawrocki, DPP, Wykład 8

ExampleExample

Verysmall

Small Medium Large Verylarge

Calculation 2.34 5.13 11.25 24.66 54.04Data 2.60 4.79 8.84 16.31 30.09I/O 9.01 12.06 16.15 21.62 28.93Logic 7.55 10.98 15.98 23.25 33.83Set-up 3.88 5.04 6.56 8.53 11.09Text 3.75 8.00 17.07 36.41 77.66

Assignment of numbers to fuzzy valuesAssignment of numbers to fuzzy valuesAssignment of numbers to fuzzy valuesAssignment of numbers to fuzzy values

J. Nawrocki, DPP, Wykład 8

ExampleExample

Base programBase program

LOC modified (M) ............................................. 5LOC modified (M) ............................................. 5

New objects Type Methods Size Total LOCNew objects Type Methods Size Total LOC

Matrix Data 13 Medium 115Matrix Data 13 Medium 115

Linear sys. Calc. 8 Large 197Linear sys. Calc. 8 Large 197

Linked list 1 Data 3 Large 49Linked list 1 Data 3 Large 49

Total new & modified (X) ................................... 366Total new & modified (X) ................................... 366

00 .................................................................... 62 .................................................................... 62

11 .................................................................... 1.3 .................................................................... 1.3

Estimated new & modified (Y) .......................... 538Estimated new & modified (Y) .......................... 538

J. Nawrocki, DPP, Wykład 8

ExampleExample

Estimated new & modified (Y) .......................... 538Estimated new & modified (Y) .......................... 538Prediction percent ............................................ 80%Prediction percent ............................................ 80%p = (1 + percent)/2 ............................................ 0.9p = (1 + percent)/2 ............................................ 0.9Number of programs in historical DB (n) .......... 10Number of programs in historical DB (n) .......... 10Std deviation Std deviation from regression line ................. from regression line ................. 198198Degrees of freedom (n-2) ................................. 8Degrees of freedom (n-2) ................................. 8tt (8, 0.9) .......................................................... (8, 0.9) .......................................................... 1.41.4(1 + 1/10 + .. ) ................................................ (1 + 1/10 + .. ) ................................................ 1.051.05Prediction range ............................................... 290Prediction range ............................................... 290Upper interval (Y + range) ................................ 828Upper interval (Y + range) ................................ 828Lower interval (Y - range) ................................. 248Lower interval (Y - range) ................................. 248

J. Nawrocki, DPP, Wykład 8

Plan of the lecturePlan of the lecture

• IntroductionIntroduction• The Probe methodThe Probe method• ExampleExample

• Effort estimationEffort estimation

J. Nawrocki, DPP, Wykład 8

Effort estimationEffort estimation

begin .. endProgramsPrograms

written so farwritten so far

Historical dataHistorical data

It should take ...a man month

to finish the project

J. Nawrocki, DPP, Wykład 8

Effort estimationEffort estimation

begin .. end

EstimatedEstimatedsizesize

ActualActualtimetime

Historical dataHistorical data

J. Nawrocki, DPP, Wykład 8

Effort estimationEffort estimation

begin .. end

EstimatedEstimatedsizesize

ActualActualtimetime

Historical dataHistorical data

rr22 0.5 0.5rr22 0.5 0.5

J. Nawrocki, DPP, Wykład 8

Effort estimationEffort estimation

Estimated sizeEstimated sizeActual timeActual time

1. 1. 00, , 11

2. Effort = 2. Effort = 11 * Estimated_size + * Estimated_size + 00

+ ...+ ...11

nn++11 3. Range = 3. Range = tt

rr22 0.5 0.5rr22 0.5 0.5

4. Effort4. Effortminmin = Effort - Range = Effort - Range

J. Nawrocki, DPP, Wykład 8

SummarySummary

Size estimation is a basis for Size estimation is a basis for effort estimation and planningeffort estimation and planning

The Probe method:The Probe method:• Historical data are needed.Historical data are needed.• Statistical methods are used.Statistical methods are used.• Programmer obtains not only Programmer obtains not only

the estimate but also a the estimate but also a prediction interval.prediction interval.

J. Nawrocki, DPP, Wykład 8

Further readingsFurther readings

W. Humphrey, A Discipline for W. Humphrey, A Discipline for Software Engineering, Addison-Software Engineering, Addison-Wesley, Reading, 1995, Chapter 5.Wesley, Reading, 1995, Chapter 5.

J. Nawrocki, DPP, Wykład 8

Quality assessmentQuality assessment

1. What is your general 1. What is your general impression ? (1 - 6)impression ? (1 - 6)

2. Was it too slow or too fast ?2. Was it too slow or too fast ?

3. Did you learn something 3. Did you learn something important to you ?important to you ?

4. What to improve and how ?4. What to improve and how ?

top related