58
(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 1 577a 2008 Tutorial: Software Cost Estimation Tools – COCOMO II and COPSEMO and COCOTS A Winsor Brown Center for Systems and Software Engineering University of Southern California [email protected]

577a 2008 Tutorial: Software Cost Estimation Tools – COCOMO II

  • Upload
    others

  • View
    7

  • Download
    2

Embed Size (px)

Citation preview

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 1

577a 2008 Tutorial:Software Cost Estimation Tools

– COCOMO II and COPSEMO and COCOTS

A Winsor Brown

Center for Systems and Software EngineeringUniversity of Southern California

[email protected]

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 2

Prepare Your Machine• 1. Copy COCOMO II folder to the Desktop from

My Computer / LabApps / Programs / COCOMO_II OR If you enough rights, download and install from the CD e.g., D:\CII2000.EXE

• 2. Download COCOMO_II_2000.3 from Class Website CSSE.USC.edu >> Courses >> Current >> CSCI 577 (AKA http://greenbay.usc.edu/csci577/fall2008/site/tools) to the same folder on the desktop OR to the same folder you in which you installed COCOMO II

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 3

CS577abc Course/Project Characteristics• Learn by Doing

• Real Projects for Real Clients

• Teaches Software Engineering of Large systems using small e-services/tools projects

• 577A: most projects through [preliminary LCA]

• 577B: ½ as many projects—Construction, Transition

• 577C [someday soon]: Maintenance and Enhancement

• Teaches Software Engineering of Medium/Large systems using small e-services or tools projects

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 4

Part I: COCOMO II Model and Demo

If you haven’t done so already, Download COCOMO II.2000.3 from the class Tools Website; Quietly, in parallel with next few slides, Copy folder “COCOMO II” to the desktop; Start the Help: Click on Help.html; explore the Model Manual—find basic equation.Start COCOMO II.2000.3; Estimate a project with

2,000 lines of code

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 5

Software Cost Estimation Methods• Cost estimation: prediction of both the

person-effort and elapsed time of a project• Methods:

– Algorithmic– Expert judgement– Estimation by analogy– Parkinsonian

• Best approach: a combination of at least two methods– compare and iterate estimates– reconcile differences

• COCOMO is the most widely used, thoroughly documented and calibrated cost model; and free

– Price-to-win– Top-down– Bottom-up– Parametric

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 6

COCOMO Background

• COCOMO - the “COnstructive COst MOdel”– COCOMO II is the update to COCOMO 1981 – Results from ongoing research with new data collection & model calibration

(SFs; more data points; new ratings values; Bayesian calibration)

• Originally developed by Dr. Barry Boehm and published in 1981 book Software Engineering Economics

• COCOMO II described in new book Software Cost Estimation with COCOMO II

• COCOMO II can be used as a framework for cost estimation and related activities

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 7

RUP/ICM Anchor Points Enable Concurrent Engineering

VCR: Valuation Commitment Review DCR: Development Commitment ReviewACR: Architecting Commitment Review OCR: Operations Commitment Review

V C R

I R R

A C R

L C O

D C R

L C A

C C D

I O C

O C R

P R R

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 8

COCOMO Black Box Model

COCOMO II

product size estimate

product, process, platform, and personnel attributes

reuse, maintenance, and increment parameters

organizationalproject data

development, maintenance cost and schedule estimates

cost, schedule distribution by phase and activity (for Elaboration and Construction!)

local recalibration toorganizational data

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 9

COCOMO Sub-models• Applications Composition involves rapid development or prototyping

efforts to resolve potential high-risk issues such as user interfaces, software/system interaction, performance, or technology maturity. It’s sized with application points (weighted screen elements, reports and 3GL modules).

• The Early Design model involves exploration of alternative software/system architectures and concepts of operation using function points and a course-grained set of 7 cost drivers.

• The Post-Architecture model involves the actual development and maintenance of a software product using source instructions and / or function points for sizing, with modifiers for reuse and software breakage; a set of 17 multiplicative cost drivers; and a set of 5 factors determining the project's scaling exponent.

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 10

# of cost driversEffort (person-months) = A (Size)BΠ EMi

i=1• Where:

– A is a constant derived from historical project data (currently A = 2.94 in COCOMOII.2000)

– Size is in KSLOC (thousand source lines of code), or converted from function points or object points

– B is an exponent for the diseconomy of scale dependent on five additive scale drivers according to b = .91 + .01*ΣSFi,where SFi is a weighting factor for ith scale driver

– EMi is the effort multiplier for the ith cost driver. The geometric product results in an overall effort adjustment factor to the nominal effort.

• Automated translation effects are not included

COCOMO Effort Formulation

Quietly: Estimate a project with 2,000 lines of code using COCOMOII_2000.3

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 11

1st Run of COCOMO II

• Start COCOMO II• Edit / Add Module Or Click on• Set Size: Click on

• Select “SLOC” Method

• Enter SLOC

• Save project in folder: “Single”

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 12

1st Run of COCOMO II (cont.)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 13

Coverage of Different Processes• COCOMO II provides a framework for tailoring the model to

any desired process• Original COCOMO was predicated on the waterfall process

– single-pass, sequential progression of requirements, design, code, test

• Modern processes are concurrent, iterative, incremental, and cyclic– e.g. Rational Unified Process (RUP), the USC Lean ICM for

Software process • Effort and schedule are distributed among different phases

and activities per work breakdown structure of chosen process

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 14

RUP/ICM Anchor Points Enable Concurrent EngineeringV C R

I R R

A C R

L C O

D C R

L C A

C C D

I O C

O C R

P R R

VCR: Validation Commitment Review DCR: Development Commitment ReviewACR: Architecting Commitment Review OCR: Operations Commitment Review

COCOMO II covers ONLY E&C (A/F & D[C])

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 15

RUP & Lean ICM for Sw Phase Distributions

RUP Phases* Lean ICM for Software Phase

Effort % Schedule %

Inception Exploration 1 2.5

Inception Valuation 5 10Elaboration Foundations 24 37.5

Construction ICM Development: Code and Test

76 47.5

Transition ICM Development: [System] Integration

12 12.5

COCOMO Total 100 100Project Total 118 125

* see COCOMO II book for complete phase/activity distributions

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 16

Part I: COCOMO II Model and Demo

• Quietly, in parallel with next few slides, copy folder with “Software Estimation” to the desktop; Download COCOMO II.2000.3 from the class Tools Website; Start the Help; Start COCOMO II.2000.3;

• Make estimate a realistic project with 2,000 lines of code: Add REVL!

• Save Project as 2ndRun

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 17

2nd Run COCOMO II

• Set REVL to 15% (a good first guess)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 18

Cost Factors• Significant factors of development cost:

– scale drivers are sources of exponential effort variation– cost drivers are sources of linear effort variation

• product, platform, personnel and project attributes• effort multipliers associated with cost driver ratings

– Defined to be as objective as possible

• Each factor is rated between very low and very high per rating guidelines– relevant effort multipliers adjust the cost up or down

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 19

Scale Drivers• Precedentedness (PREC)

– Degree to which system is new and past experience applies• Development Flexibility (FLEX)

– Need to conform with specified requirements• Architecture/Risk Resolution (RESL)

– Degree of design thoroughness and risk elimination• Team Cohesion (TEAM)

– Need to synchronize stakeholders and minimize conflict• Process Maturity (PMAT)

– SEI CMM process maturity rating

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 20

Scale Factors• Sum scale factors SFi across all of the factors to determine

a scale exponent, B, using B = .91 + .01 Σ SFi

Scale Factors (Wi) Very Low Low Nominal High Very High Extra HighPrecedentedness

(PREC)thoroughlyunprecedented

largelyunprecedented

somewhatunprecedented

generallyfamiliar

largelyfamiliar

throughlyfamiliar

DevelopmentFlexibility (FLEX)

rigorous occasionalrelaxation

somerelaxation

generalconformity

someconformity

generalgoals

Architecture/RiskResolution (RESL)*

little (20%) some (40%) often (60%) generally(75%)

mostly(90%)

full (100%)

Team Cohesion(TEAM)

very difficultinteractions

some difficultinteractions

basicallycooperativeinteractions

largelycooperative

highlycooperative

seamlessinteractions

Process Maturity(PMAT)

Weighted average of “Yes” answers to CMM Maturity Questionnaire

* % significant module interfaces specified, % significant risks eliminated

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 21

Cost Drivers• Product Factors

– Reliability (RELY)– Data (DATA)– Complexity (CPLX)– Reusability (RUSE)– Documentation (DOCU)

• Platform Factors– Time constraint (TIME)– Storage constraint (STOR)– Platform volatility (PVOL)

• Personnel factors– Analyst capability (ACAP)– Program capability (PCAP)– Applications experience (APEX)– Platform experience (PLEX)– Language and tool experience

(LTEX)– Personnel continuity (PCON)

• Project Factors– Software tools (TOOL)– Multisite development (SITE)– Required schedule (SCED)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 22

Example Cost Driver - Required Software Reliability (RELY)

• Measures the extent to which the software must perform its intended function over a period of time.

• Ask: what is the effect of a software failure?

Very Low

Low

Nominal

High

Very High

Extra High

RELY

slight inconvenience

low, easily recoverable losses

moderate, easily recoverable losses

high financial loss

risk to human life

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 23

Significant CSCI577A Scale Factors• PREC• RESL

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 24

Significant CSCI577A Effort MultipliersDATA DOCU PCON

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 25

Significant CSCI577A Effort MultipliersDATA DOCU PCON

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 26

Part I: COCOMO II Model and Demo Exercise 3

• Set Significant SF• Set Significant EAFs • Save Project as 3rdRun

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 27

3rd Run COCOMO II

• Set PREC to Low

• Set RESL to High

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 28

3rd Run COCOMO II (cont.)

• Set RELY to 50% of Low to Nominal

• Set DATA to Low

• Set DOCU to High

• Set PCON to Very Low

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 29

3rd Run COCOMO II (cont.)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 30

Add Reused Component: Realistic Estimates

• Define some Re-Use Model• Do another exercise

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 31

Reused and Modified Software

• Effort for adapted software (reused or modified) is not the same as for new software.

• Approach: convert adapted software into equivalent size of new software.

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 32

Nonlinear Reuse Effects• The reuse cost function does not go through the origin due to a

cost of about 5% for assessing, selecting, and assimilating the reusable component.

• Small modifications generate disproportionately large costs primarily due the cost of understanding the software to be modified, and the relative cost of interface checking.

Relativecost

Amount Modified

1.0

0.75

0.5

0.25

0.25 0.5 0.75 1.0

0.55

0.70

1.0

0.046

Usual LinearAssumption

Data on 2954NASA modules

[Selby,1988]

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 33

COCOMO Reuse Model• A nonlinear estimation model to convert adapted

(reused or modified) software into equivalent size of new software:

AAF DM CM IM= + +0 4 0 3 0 3. ( ) . ( ) . ( )

ESLOCASLOC AA AAF SU UNFM

AAF=+ +

≤[ ( . ( )( ))]

, .1 0 02100

05

ESLOCASLOC AA AAF SU UNFM

AAF=+ +

>[ ( )( )]

, .100

05

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 34

COCOMO Reuse Model (cont’d)• ASLOC - Adapted Source Lines of Code• ESLOC - Equivalent Source Lines of Code• AAF - Adaptation Adjustment Factor• DM - Percent Design Modified. The percentage of the adapted software's

design which is modified in order to adapt it to the new objectives and environment.

• CM - Percent Code Modified. The percentage of the adapted software's code which is modified in order to adapt it to the new objectives and environment.

• IM - Percent of Integration Required for Modified Software. The percentage of effort required to integrate the adapted software into an overall product and to test the resulting product as compared to the normal amount of integration and test effort for software of comparable size.

• AA - Assessment and Assimilation effort needed to determine whether a fully- reused software module is appropriate to the application, and to integrate its description into the overall product description. See table.

• SU - Software Understanding. Effort increment as a percentage. Only used when code is modified (zero when DM=0 and CM=0). See table.

• UNFM - Unfamiliarity. The programmer's relative unfamiliarity with the software which is applied multiplicatively to the software understanding effort increment (0-1).

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 35

Sizing - Lines of Code• Source Lines of Code (SLOCs) = logical source statements

• Logical source statements = data declarations + executable statements

• Executable statements cause runtime actions

• Declaration statements are non-executable statements that affect an assembler's or compiler's interpretation of other program elements

• CodeCount tool available on CSSE website

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 36

USC COCOMO II Exercise 4• Re-do COCOMO II Estimation

– Size: 3300 Total SLOC in two modules; • Re-Use 1,500 SLOC from Open Source Library

– DM, CM = 0; IM = 50%; – Unfm=.80

• 1,800 new SLOC– SFs as appropriate based on earlier discussion

PREC to Low RESL to High

– EAFs as appropriate based on earlier discussion RELY to 50% Low to Nom DATA to Low DOCU to High PCON to Very Low

• Save project (4thRun) in new folder “2Modules”

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 37

4th Run COCOMO II

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 38

4th Run COCOMO II (cont.)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 39

Schedule and Effort Over Full SDLC*

• COCOMO II Covers Elaboration and Construction

• COPSEMO to spread Effort and Schedule over ALL phases – COPSEMO uses COCOMO_Charts.xls as a helper

* Software Development Life Cycle (of a system Increment)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 40

RUP/ICM Anchor Points Enable Concurrent EngineeringV C R

I R R

A C R

L C O

D C R

L C A

C C D

I O C

O C R

P R R

VCR: Validation Commitment Review DCR: Development Commitment ReviewACR: Architecting Commitment Review OCR: Operations Commitment Review

COCOMO II covers ONLY E&C (A/F & D[C])

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 41

RUP & [Instructional] ICM for Sw Phase Distributions

RUP Phases* Lean ICM for Software Phase

Effort % Schedule %

Inception Exploration 1 2.5

Inception Valuation 5 10Elaboration Foundations 24 37.5

Construction ICM Development: Code and Test

76 47.5

Transition ICM Development: [System] Integration

12 12.5

COCOMO Total 100 100Project Total 118 125

* see COCOMO II book for complete phase/activity distributions

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 42

COPSEMO Distributes Effort & Schedule

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 43

Physical COCOMO II PSE (CoPSEMo) Extension

Stage Distributions

(COPSEMO Extension)

COCOMO II.2000 COCOMO II cost drivers

% Distributions of Schedule and Effort

Schedule calculated; SCED removed; PM & M distributed per stage

Baseline Effort & Sched.

COCOMO.xls

Main.csv & Phase.csv

Workhours per month

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 44

Do a COPSEMO Run on 4th Example

• Export … (CSV to folder with saved 4thRun example) [creates Phases.csv and Modules.csv]

• Install COPSEMO: Save COPSEMO.xls to folder with saved example from http://greenbay.usc.edu/csci577/tools/COPSEMO/COPSEMOv8.xls

• Copy COCOMO_charts.xls from COCOMO Installation folder to folder with saved example

• Run COCOMO_charts.xls; Import; save and close• Run COPSEMOv8.xls (may have to fix link)

[Edit/Links .. Change Source]

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 45

Size Estimation• By analogy with Wide-Band Delphi before LCO

– Ask each team member what they think the size might be

• Apply personal experience, • Look at completed projects, • Guess (WAG), • SWAG based on “modules” known to date

– Collect and share in a meeting: discuss why/how different people made their estimate

– Repeat – When stable, Size = (H + 4 X Ave. + L)/6

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 46

Size Estimation• By analogy with Wide-Band Delphi after LCO

– Measure Size of Prototype Code (CodeCount, or other tools)– Measure Size of Reused Code (CodeCount, or other tools)– Ask each team member what they think the final size might

be• Extrapolate from prototype (apply personal experience)• Guess (WAG), • SWAG based on “modules” known to date

– Collect and share in a meeting: discuss why/how different people made their estimate

– Repeat – When stable, Size = (H + 4 X Ave. + L)/6

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 47

Size Estimation• By analogy with Wide-Band Delphi before LCA Draft

– Measure Size of “final” Prototype Code; provide along with original prototype code measure

– Measure Size of Reused Code (CodeCount, or other tools)– Ask each team member what they think the final size might

be• Extrapolate from prototypes (apply personal experience?)• Guess (WAG), • SWAG based on “modules” known to date

– Collect and share in a meeting: discuss why/how different people made their estimate

– Repeat – When stable, Size = (H + 4 X Ave. + L)/6

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 48

COCOMO II Estimates in 577A

For Homework: “Homework 4: Cost Estimation”; Due 09/26/08!

For Project

• Before FCR/ACR/LCO (for ARB)

• After FCR/ACR/LCO ARB (for grading)

• Before DCR/LCA (for ARB)

• After DCR/LCA ARB (after re-scoping guidance) (for grading, “plan” for 577B, or actuals)

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 49

Incremental Commitment Model in Software Engineering Class

06/24/08 ©USC-CSSE 49

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 50

Part II: COCOTS Model and Demo

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 51

Relationship between CII and COCOTS

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 52

COCOTS

• COCOTS is the acronym for the Constructive COTS integration cost estimation model

• A member of the USC COCOMO II family of cost estimation models

• For estimating the expected initial cost of integrating COTS software into a new software system development

• Three sub-models: – COTS Assessment– COTS Tailoring– COTS Glue code development

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 53

COTS Assessment Sub-model• COTS Assessment:

the activity of determining the appropriateness or feasibility of using specific COTS products to fulfill required system functions.

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 54

COTS Tailoring Sub-model• COTS Tailoring: the activity associated with setting or

defining shell parameters or configuration options available for a COTS product, but which do not require modification of COTS source code, including defining I/O report formats, screens, etc.

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 55

COTS Glue Code Sub-model

• COTS “glue” code/integration refers to software developed in-house and composed of – 1) code needed to facilitate data or information exchange

between the COTS and the system or other COTS;

– 2) code needed to connect the COTS into the system or other COTS but does not necessarily enable data exchange;

– 3) code needed to provide required functionality missing in the COTS AND which depends upon or must interact with the COTS.

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 56

COTS Glue Code Sub-model Formula

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 57

Total COCOTS Estimation

• Sum of three sub-models’ estimates:– EffortCOT = EffortA + EffortT + EffortGC

• “Grand” total effort for developing a COTS-Based System (CBS):– EffortCBS = EffortCOC + EffortCOT

(c) 2004-2008 USC CSSE CSCI 577a 2008 COCOMO Tutorial 58

Questions and Answers• Questions from you?

• Question from HHGG: “the great question of Life, The Universe and Everything”.

• Answer: 42! (1010102 )