CS451 Lecture 5: Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

31
CS451 - Lecture 5 1 CS451 Lecture 5: Project Metrics and Estimation [Pressman, Chapters 22, 23]

description

CS451 Lecture 5: Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]. A Good Manager Measures. process. process metrics. project metrics. measurement. product metrics. product. What do we. use as a. basis?. • size?. • function?. Why Do We Measure?. - PowerPoint PPT Presentation

Transcript of CS451 Lecture 5: Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

Page 1: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 1

CS451Lecture 5: Project Metrics and

Estimation[Pressman, Chapters 22, 23]

Page 2: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 2

A Good Manager Measures

measurementmeasurement

What do weWhat do weuse as ause as abasis?basis? • • size?size? • • function?function?

project metricsproject metrics

process metricsprocess metricsprocessprocess

productproduct

product metricsproduct metrics

Page 3: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 3

Why Do We Measure?

assess the status of an ongoing projecttrack potential risksuncover problem areas before they go “critical,”adjust workflow or tasks, evaluate the project team’s ability to control

quality of software work products.

Page 4: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 4

Process Measurement We measure the efficacy of a software process

indirectly. Derive a set of metrics based on the outcomes that can be

derived from the process. Outcomes include

measures of errors uncovered before release of the software defects delivered to and reported by end-users work products delivered (productivity) human effort expended calendar time expended schedule conformance other measures.

We also derive process metrics by measuring the characteristics of specific software engineering tasks.

Page 5: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 5

Process Metrics

Quality-related focus on quality of work products and deliverables

Productivity-related Production of work-products related to effort expended

Statistical SQA data error categorization & analysis

Defect removal efficiency propagation of errors from process activity to activity

Reuse data The number of components produced and their degree of

reusability

Page 6: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 6

Project Metrics

used to minimize the development schedule by making the adjustments necessary to avoid delays and mitigate potential problems and risks

used to assess product quality on an ongoing basis and, when necessary, modify the technical approach to improve quality.

every project should measure: inputs—measures of the resources (e.g., people, tools) required to

do the work. outputs—measures of the deliverables or work products created

during the software engineering process. results—measures that indicate the effectiveness of the

deliverables.

Page 7: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 7

Typical Project Metrics

Effort/time per software engineering taskErrors uncovered per review hourScheduled vs. actual milestone datesChanges (number) and their characteristicsDistribution of effort on software engineering

tasks

Page 8: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 8

Typical Size-Oriented Metrics

errors per KLOC (thousand lines of code)defects per KLOC$ per LOCpages of documentation per KLOCerrors per person-monthErrors per review hourLOC per person-month$ per page of documentation

Page 9: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 9

Typical Function-Oriented Metrics

errors per FP (thousand lines of code)defects per FP$ per FPpages of documentation per FPFP per person-month

Page 10: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 10

Comparing LOC and FP

Programming LOC per Function point

Language avg. median low high

Ada 154 - 104 205Assembler 337 315 91 694C 162 109 33 704C++ 66 53 29 178

COBOL 77 77 14 400Java 63 53 77 -JavaScript 58 63 42 75Perl 60 - - -PL/1 78 67 22 263Powerbuilder 32 31 11 105SAS 40 41 33 49Smalltalk 26 19 10 55SQL 40 37 7 110Visual Basic 47 42 16 158

Representative values developed by QSM

Page 11: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 11

Why Opt for FP?

Programming language independentUsed readily countable characteristics that

are determined early in the software process

Does not “penalize” inventive (short) implementations that use fewer LOC that other more clumsy versions

Makes it easier to measure the impact of reusable components

Page 12: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 12

Object-Oriented Metrics

Number of scenario scripts (use-cases)Number of support classes (required to

implement the system but are not immediately related to the problem domain)

Average number of support classes per key class (analysis class)

Number of subsystems (an aggregation of classes that support a function that is visible to the end-user of a system)

Page 13: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 13

WebE Project Metrics

Number of static Web pages (the end-user has no control over the content displayed on the page)

Number of dynamic Web pages (end-user actions result in customized content displayed on the page)

Number of internal page links (internal page links are pointers that provide a hyperlink to some other Web page within the WebApp)

Number of persistent data objects Number of external systems interfaced Number of static content objects Number of dynamic content objects Number of executable functions

Page 14: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 14

Measuring Quality

Correctness — the degree to which a program operates according to specification

Maintainability—the degree to which a program is amenable to change

Integrity—the degree to which a program is impervious to outside attack

Usability—the degree to which a program is easy to use

Page 15: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 15

Estimation Techniques

Past (similar) project experienceConventional estimation

techniques task breakdown and effort

estimates size (e.g., FP) estimates

Empirical modelsAutomated tools

Page 16: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 16

Functional Decomposition

functional functional decompositiondecomposition

StatementStatementofof

ScopeScopePerform a Perform a

Grammatical “parse”Grammatical “parse”

Page 17: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 17

Conventional Methods:LOC/FP Approach

compute LOC/FP using estimates of information domain values

use historical data to build estimates for the project

Page 18: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 18

Example: LOC Approach

Average productivity for systems of this type = 620 Average productivity for systems of this type = 620 LOC/pm. LOC/pm.

Burdened labor rate =$8000 per month, the cost per Burdened labor rate =$8000 per month, the cost per line of code is approximately $13. line of code is approximately $13.

Based on the LOC estimate and the historical Based on the LOC estimate and the historical productivity data, the total estimated project cost is productivity data, the total estimated project cost is $431,000 and the$431,000 and the estimated effort is 54 person- estimated effort is 54 person-months.months.

Page 19: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 19

Example: FP Approach

The estimated number of FP is derived:The estimated number of FP is derived:FPFPestimatedestimated = count-total = count-total xx [0.65 + 0.01 [0.65 + 0.01 xx (F (Fii)])]

FPFPestimatedestimated = 375 = 375

organizational average productivity = 6.5 FP/pm. organizational average productivity = 6.5 FP/pm. burdened labor rate = $8000 per month, the cost per FP is burdened labor rate = $8000 per month, the cost per FP is approximately $1230. approximately $1230. Based on the FP estimate and the historical productivity data,Based on the FP estimate and the historical productivity data, the total the total estimated project cost is $461,000 and the estimated effort is 58 person-estimated project cost is $461,000 and the estimated effort is 58 person-monthsmonths..

Page 20: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 20

Process-Based EstimationObtained from “process framework”Obtained from “process framework”

applicationapplicationfunctionsfunctions

framework activitiesframework activities

Effort required to Effort required to accomplishaccomplisheach framework each framework activity for each activity for each application functionapplication function

Page 21: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 21

Process-Based Estimation ExampleActivity

Task

Function

UICF2DGA3DGA

DSMPCF

CGDF

DAM

Totals

% effort

CC PlanningRisk

Analysis EngineeringConstruction

Release TotalsCE

analysis design code test

0.25 0.25 0.25 3.50 20.50 4.50 16.50 46.00

1% 1% 1% 8% 45% 10% 36%

CC = customer communication CE = customer evaluation

0.500.750.500.500.500.25

2.504.004.003.003.002.00

0.400.601.001.000.750.50

5.002.003.001.501.501.50

8.407.358.506.005.754.25

0.50 2.00 0.50 2.00 5.00

n/an/an/an/an/an/an/a

Based on an average burdened labor rate of $8,000 per Based on an average burdened labor rate of $8,000 per month, the total estimated project cost is $368,000 and the month, the total estimated project cost is $368,000 and the estimated effort is 46 person-months.estimated effort is 46 person-months.

Page 22: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 22

Tool-Based Estimation

project characteristicsproject characteristics

calibration factorscalibration factors

LOC/FP dataLOC/FP data

Page 23: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 23

Estimation with Use-Cases

use cases scenarios pages Ź scenarios pages LOC LOC estimatee subsystem 6 10 6 Ź 12 5 560 3,366subsystem group 10 20 8 Ź 16 8 3100 31,233e subsystem group 5 6 5 Ź 10 6 1650 7,970

Ź Ź Ź Źstimate Ź Ź Ź Ź 42,568

User interface subsystem Engineering subsystem group Infrastructure subsystem group

Total LOC estimate

Using 620 LOC/pm as the average productivity for systems Using 620 LOC/pm as the average productivity for systems of this type and a burdened labor rate of $8000 per month, of this type and a burdened labor rate of $8000 per month, the cost per line of code is approximately $13. Based on the the cost per line of code is approximately $13. Based on the use-case estimate and the historical productivity data, the use-case estimate and the historical productivity data, the total estimated project cost is $552,000 and the estimated total estimated project cost is $552,000 and the estimated effort is 68 person-months.effort is 68 person-months.

Page 24: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 24

Empirical Estimation Models

General form:General form:

effort = tuning coefficient * sizeeffort = tuning coefficient * sizeexponentexponent

usually derivedusually derivedas person-monthsas person-monthsof effort requiredof effort required

either a constant oreither a constant ora number derived based a number derived based on complexity of projecton complexity of project

usually LOC butusually LOC butmay also bemay also befunction pointfunction point

empiricallyempiricallyderivedderived

Page 25: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 25

COCOMO-II COCOMO II is actually a hierarchy of

estimation models that address the following areas:

Application composition model. Used during the early stages of software engineering, when prototyping of user interfaces, consideration of software and system interaction, assessment of performance, and evaluation of technology maturity are paramount.

Early design stage model. Used once requirements have been stabilized and basic software architecture has been established.

Post-architecture-stage model. Used during the construction of the software.

Page 26: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 26

The Software EquationA dynamic multivariable modelA dynamic multivariable model

E = [LOC x BE = [LOC x B0.3330.333/P]/P]33 x (1/t x (1/t44))

where where E = effort in person-months or person-yearsE = effort in person-months or person-yearst = project duration in months or yearst = project duration in months or yearsB = “special skills factor”B = “special skills factor”P = “productivity parameter”P = “productivity parameter”

Page 27: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 27

Estimation for OO Projects-I Develop estimates using effort decomposition, FP

analysis, and any other method that is applicable for conventional applications.

Using object-oriented analysis modeling (Chapter 8), develop use-cases and determine a count.

From the analysis model, determine the number of key classes (called analysis classes in Chapter 8).

Categorize the type of interface for the application and develop a multiplier for support classes: Interface type Multiplier No GUI 2.0 Text-based user interface 2.25 GUI 2.5 Complex GUI 3.0

Page 28: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 28

Estimation for OO Projects-II

Multiply the number of key classes (step 3) by the multiplier to obtain an estimate for the number of support classes.

Multiply the total number of classes (key + support) by the average number of work-units per class. Lorenz and Kidd suggest 15 to 20 person-days per class.

Cross check the class-based estimate by multiplying the average number of work-units per use-case

Page 29: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 29

Estimation for Agile Projects Each user scenario (a mini-use-case) is considered separately for

estimation purposes. The scenario is decomposed into the set of software engineering

tasks that will be required to develop it. Each task is estimated separately. Note: estimation can be based

on historical data, an empirical model, or “experience.” Alternatively, the ‘volume’ of the scenario can be estimated in LOC, FP or

some other volume-oriented measure (e.g., use-case count). Estimates for each task are summed to create an estimate for the

scenario. Alternatively, the volume estimate for the scenario is translated into effort

using historical data. The effort estimates for all scenarios that are to be implemented

for a given software increment are summed to develop the effort estimate for the increment.

Page 30: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 30

The Make-Buy Decision

system Xsystem Xreusereuse

simple (0.30)simple (0.30)

difficult (0.70)difficult (0.70)

minorminor changeschanges

(0.40)(0.40)

majormajorchangeschanges

(0.60)(0.60)

simple (0.20)simple (0.20)

complex (0.80)complex (0.80)

majormajor changeschanges (0.30)(0.30)

minorminor changeschanges

(0.70)(0.70)

$380,000$380,000

$450,000$450,000

$275,000$275,000

$310,000$310,000

$490,000$490,000

$210,000$210,000

$400,000$400,000

buybuy

contractcontract

without changes (0.60)without changes (0.60)

with changes (0.40)with changes (0.40)

$350,000$350,000

$500,000$500,000

buildbuild

Page 31: CS451 Lecture 5:  Project Metrics and Estimation [Pressman, Cha pters 22, 23 ]

CS451 - Lecture 5 31

Computing Expected Cost

(path probability) x (estimated path cost) (path probability) x (estimated path cost) ii ii

For example, the expected cost to build is:For example, the expected cost to build is:

expected cost = 0.30 ($380K) + 0.70 ($450K) expected cost = 0.30 ($380K) + 0.70 ($450K)

similarly,similarly,

expected cost (reuse) = $382Kexpected cost (reuse) = $382Kexpected cost (buy) = $267Kexpected cost (buy) = $267Kexpected cost (contr) = $410Kexpected cost (contr) = $410K

buildbuild

expected cost =expected cost =

= $429 K= $429 K