SoftwareCostEstimation Spring,2012
Chapter 3 SOFTWARE COST ESTIMATION DB Liu Software Cost Estimation
INTRODUCTION Estimating the cost of a software product is one of the most difficult and error-prone tasks in software engineering (unknown factors during planning phase). But contracting practices often requires a firm cost commitments as part of the feasibility study. ~ Some organizations use a series of cost estimates: A preliminary cost estimate is prepared during the planing phase and presented at projectfeasibility review, and an improved estimate is presented at the software requirements review(srr). A second estimate is presented at the preliminary design review(pdr). And a final estimate is presented at the Critical Design Review(CDR). DB Liu Software Cost Estimation 3
3~1 SOFTWARE COST FACTORS Major factors that influence software cost: 1. Programmer ability 20 Product complexity 3. Product size 4. Available time 5. Required reliability 6. Level of technology DB Liu Software Cost Estimation 4
3e1.1 PROGRAMMER ABILITY Nevertheless, variability of 5 to 1 in programmer productivity is a significant factor in cost estimation. On very large projects, the differences in individual programmer ability will tend to average out, but on projects utilizing five or fewer programmers, individual differences in ability can be significant. DB Liu Software Cost Estimation 5
3~1.2 PRODUCT COMPLEXITY Three levels of product complexity are organic, semidetached, and embedded programs. These levels roughly correspond to application programs (data processing and scientific programs), utility programs (compilers, linkage editors, inventory systems), and systems programs (operating systems, data-base management systems). PM = programmer-months of effort, in terms of thousands delivered source instructions (KDSI), given by Boehrn: Application programs: PM = 2.4*(KDSI)**1.05 Utility programs: PM = 3.O*(KDSI)**1.12 Systems Programs: PM = 3.6*(KDSI)**1.20 (See graphs of these equations on next pages) Programmer cost for the software project can be obtained by rnulçipiying the effort in programmer-months by the cost per programmer-month. DB Liu Software Cost Estimation 6
COCOMO EFFORT ESTIMATES Systems 0 Utility E 100 300 Pioduct ~~Le KUSI 500 Figure 3.1 Cocotito effort estimates (BOE8J). DB Liu Software Cost Estimation 7
3.1~2 PRODUCT COMPLEXITY (cont.) The ~ç~çp line for a program, as given by Boehm, is: Application programs: Utility programs: Systems Programs: TDEV = 2.5*(PM)**O.38 TDEV = 2.5*(PM)**O.35 TDEV = 2.5*(PM)**O,32 (See graphs of these equations on next page) The Development Time is roughly the same for all three types of systems. For example, a 60 KDSI program can be developed in approximately 18 months, regardless of its complexity level. DB Liu Software Cost Estimation 8
COCOMO SCHEDULE ESTIMTES Utility Systems 0 E 4) :1 0 4) 4, 18F 121 61 100 200 300 400 Product size~kdsl 600 Figure 3.2 Cocomo schedule estimates (BOE8I). DB Liu Software Cost Estimation 9
3.1.2 PRODUCT COMPLEXITY (cont.) Average Staffing Level Given total programmer-months for a project and nominal development time required, the Average Staffing Level can be obtained by simple division. For our 60 KDSI program, we obtain the following results: Application programs: Utility programs: Systems Programs: 176.6 PM / 17.85 MO = 9.9 programmers 294 PM / 18.3 MO = 16 programmers 489.6 PM / 18.1 MO = 27 programmers ~ It must be emphasized that these above results presented only for the purpose of illustration. These equations should NOT be used to estimate software effort without careful readini~ ofboehin to understand the assumptions and limitations of the method. The estimates are no better than our ability to estimate the final number of instructions (KDSI) in the program. DB Liu Software Cost Estimation ~j 0
3.1.3 PRODUCT SIZE A large sofiware product is obviously more expensive to develop than a small one. Boehm s equations indicate that the rate of increase in required effort grows with the number of source instructions at an exponential rate slightly greater than 1. Table 12 Effort and schedule estimators (BOE8I) Effort equation Schedule equation Reference MM = 5~2(KDSI)**O.91 TDEV = 2.47(MM)**O~35 (WAL77) MM = 4.9(KDSI)**O.98 TDEV 3.04(MM)**O.36 (NEL78) MM = L5(KDSJ)**1.02 TDEV = 4.38(MM)**O.25 (FRE79) MM 2.4(KDSI)**1.05 TDEV = 2.50(MM)**O.38 (BOE81) MM = 3.O(KDSI)**1.12 TDEV = 2.50(MM)**O.35 (BOE81) MM = 3~6(KDSI)**1.2O TDEV = 2.50(MM)**O.32 (BOE81) MM = 1.O(KDSI)**1.40 (J0N77) MM = O.7(KDSI)**l.50 (11AL77) MM = 28 (KDSI)** 1.83 (5CH78) DB Liu Software Cost Estimation 11
3d 4 AVAILABLE TIME Total project effort is sensitive to the calendar time available for project completion. Most investors agree that sofiware projects require more total effort if development time is compressed or expanded from the optimal time. The results are shown in following figure: 1.5 ~(RCA 78) 78) 0 z w 01 0 > 4.- 1.3.- 1.2 1.1 -- \ / / / / d // (AIR 74) (13(712 81) (1.9 Figure 3.3 Relative effort for off-nominal schedules (BOE$i ). DB Liu Software Cost Estimation 12
3.1.4 AVAILABLE TIME (cont,) In a study of 63 software projects, Boehm found that only four had compression factors less than 75 percent of the development time predicted by his cost estimation model. Boehm states: There is a limit beyond which a software project cannot reduce its schedule by buying more personnel and equipment. This limit occurs roughly at 75% of the nominal schedule. DB Liu Software Cost Estimation 13
3~1~5 REQUIRED LEVEL OF RELIABILITY Software Reliability can be defined as the probability that a program will perform a required function under stated conditions for a stated period of time. Reliability can be expressed in terms of accuracy, robustness, completeness, and consistency of the source code. There is a cost associated with the increased level ofanalysis, design, implementation, and ver~fication and validation effort that must be exerted to ensure high reliability. Boehm describes 5 categories of reliability and recommends a development effort multiplier for each. (See table in next page) DB Liu Software Cost Estimation 14
DEVELOPMENT EFFORT MULTIPLIERS FOR SOFTWARE RELIABILITY Category Effect of failure Effort Multiplier Very low Slight inconvenience 0.75 Low Losses easily recovered 0.88 Normal Moderately difficult to recover losses 1.00 High High financial loss 1.15 Very high Risk to human life 1.40 0 Note that multipliers range from 0.75 for very low reliability to 1.4 for very high reliability. The effort ration is thus 1.87 (1.4/0.75). DB Liu Software Cost Estimation 15
3.1.6 LEVEL OF TECHNOLOGY Level of Technology in a software development project is reflected by the programming language, the abstract machine (hardware and software), the programming practices, and the software tools used. Use of a high level language instead of assembly language increases programmer productivity by a factor of 5 to 10. Modem programming languages provide additional features to improve programmer productivity and software reliability. These features include: strong type-checking, data abstraction, separate compilation, exception handling, interrupt handling, and concurrency mechanism. Use of Modern Programming Practices (systematic analysis and design techniques, structured design notations, walkthroughs and inspections, structured coding, systematic testing, program development library). DB Liu Software Cost Estimation 16
3J,6 LEVEL OF TECHNOLOGY (cont0) ~ Use of Modern Development Tools (requirements specification analyzer, fully integrated development environments that include configuration management and automated verification tools.) Boehm provides Effort Multipliers for modem programming practices that range from 1.24 (no modem practices) to 0.82 (full use of modem practices), and Effort Multipliers for software tools that range from 1.24 (very basic tools) to 0.83 (advanced development tools). Thus, the use of modem practices and the use of modem development tools, can each reduce programming effort to 0.67 (0.82/1.24) of the effort required using assembly language and primitive development tools. Use of both modern practices and modern development tools can reduce development effort to 0.45 (0.67*0.67) of that required using primitive tools and techniques. DB Liu Software Cost Estimation 17
3.2 SOFTWARE COST ESTIMATION TECHNIQUES In most organizations, software cost estimates are based on past performance. * Top-down Cost Estimation: First focuses on system-level costs such as computing resources and personnel required, configuration management, quality assurance, system integration, training, and publications. * Bottom-up Cost Estimation: First estimate the cost to develop each module or subsystem. Those costs are combined to arrive at an overall estimate. Cost estimates can be made either top-down or bottom-up. In practice, both top-down and bottom-up cost estimates should be developed, compared, and iterated to estimate differences. DB Liu Software Cost Estimation 18
3.2.1 EXPERT JUDGMENT The most widely used cost estimation technique is expert judgment (a top-down technique). Expert judgment relies on the experience, background, and business sense of one or more key people in the organization. Groups of experts sometimes prepare a consensus estimate. * Disadvantage of group estimate is the possible presence of authority figures in the group, or the dominance of an overly assertive group member. DB Liu Software Cost Estimation 19
3.2.2 DELPHI COST ESTIMATION The Delphi technique was developed at the Rand Corporation to gain expert consensus without introducing the adverse side effects ofgroup meetings. The Delphi technique can be adapted to software cost estimation in the following manner: (1) A coordinator provides each estimator with the System Definition document and a form for recording a cost estimate. (2) Estimators study the definition and complete their estimates anonymously. They may ask questions of the coordinator, but they do not discus their estimates with one another. (3) The coordinator prepares and distributes a summary of the estimators responses, and includes any unusual rationales noted by the estimators. (4) Estimators complete another estimate, again anonymously, using the results from the previous estimate. Estimators whose estimate differ sharply from the group may be asked, anonymously, to provide justification for their estimates. (5) The process is iterated for as many rounds as required. No group discussion is allowed during the entire process. DB Liu Software Cost Estimation 20
3~2,3 WORK BREAKDOWN STRUCTURES The WBS is a bottom-up estimation tool. A WBS is a hierarchical chart that accounts for the individual parts of a system. A BWS chart can indicate either product hierarchy or process hierarchy. Product hierarchy identifies the product components and indicates the manner in which the components are interconnected. Using WBS technique, costs are estimated by assigning costs to each individual component in the chart and summing the costs. (See WBS figure on next page) DB Liu Software Cost Estimation 21
3.2.3 WORK BREAKDOWN STRUCTURES (cont.) DB Liu Software Cost Estimation 22
3.3~4 ALGORITHMIC COST MODELS Algorithmic Cost Estimators compute the estimated cost of a software system as the sum of costs of the modules and subsystems that comprise the system. It is a bottom-up estimator The COnstructive COst Model (COCOMO) is an algorithmic cost model described by Boehm. When using COCOMO, Boehm s equations are used to provide nominal estimates of Programmer-Months and Development Schedule for a program unit, based on the estimated number of Delivered Source Instructions (DSI) in the unit. [DSJ s all statements, exclude comments and unmodified utility routines.] DB Liu Software Cost Estimation 23
3,3.4 ALGORITHMIC COST MODELS (cont.) Effort Multipliers are then used to adjust the estimate for Product Attributes, Computer Attributes, Personnel Attributes, and Project Attributes. See the Table on next page for COCOMO Effort Multipliers and their ranges of values. DB Liu Software Cost Estimation 24
3 3~4 ALGORITHMIC COST MODELS Table3A COCOMO effort mufltipliers Multiplier Range of values Product attributes Required reliability 0.75 to 1.40 Data-base size 0.94 to 1.16 Product complexity 0.70 to 1.65 Computer attributes Execution time constraint 1.00 to 1.66 Main storage constraint 1.00 to 1.56 Virtual machine volatility 0.87 to 1.30 Computer turnaround time 0.87 to 1.15 Personnel attributes Analyst capability 1.46 to 0.71 Programmer capability 1.42 to 0.70 Applications experience 1.29 to 0.82 Virtual machine experience 1.21 to 0.90 Programming language experience 1.14 to 0.95 Project attributes Use of modem programming practices 1.24 to 0.82 Use of software tools 1.24 to 0.83 Required development schedule 1.23 to 1. 10 DB Liu Software Cost Estimation 25
3.3.4 ASSUMPTIONS MADE FOR COCOMO Small to Medium size project ( 2K to 32K DSI) Familiar application areas Stable, well-understood virtual machine o Definition and validation requirements are performed by a small group of capable people. Requirements are stable throughout the proj ect Architectural design is performed by a small number of capable people Detailed design, coding, unit testing are performed in parallel by groups of programmers working in teams Integration testing is based on early test planning Interface errors are mostly found by unit testing and by inspection and walkthroughs before integration testing o Documentation is performed incrementally as part of the development process. DB Liu Software Cost Estimation 26
3.3,4 ALGORITHMIC COST MODELS (cont.) EXAMPLES: To develop a 1 O-KDSI embedded software product for telecommunication processing. Step 1: The nominal effort equations predict: PM = 3.6*(1O)**1.20 = 57.1 TDEV = 2.5*(44.4)**O.32 = 8.4 Step 2: Effort Multipliers are used to adjust the estimate for off-nominal aspects of the project: See table 3.5 from Fairley s book on next page (the effort adjustment factor of 1.17 is the product of the effort multipliers shown in that table) Adjusted PM = PM * 1.17 = 57.1 * 1.17 66.8 programmer-months. Adjusted-TDEV = TDEV* 1.17 = 8.4*1.17 = 9.83 months. DB Liu Software Cost Estimation 27
3.3.4 ALGORITHMIC COST MODELS (cont.) Table 3.5 Effort multipliers for embedded telecommunications example Multiplier Rationale Value Reliability Local use only. No serious recovery problems (nominal) 1.00 Database 20,000 bytes (low) 0.94 Complexity Telecommunication processing (very high) 1.30 Timing Will use 70% of processing time (high) 1.11 Storage 45K of 64K available (high) 1.06 Machine Stable. c ommercially available microprocessor (nominal) 1.00 Tu~riaround Two hours average (nominal) 1.00 Analysts Good senior people (high) 0.86 Programmers Good senior people (high) 0.86 Experience Three years in telecomrn (nominal) 1.00 Experience Six months on the micro (low) 1.10 Experience Twelve months with the language (nominal) 1.00 Practices More than 1 year experience with modem techniques (high) 0.91 Tools Basic micro software (low) 1.10 Schedule Nine months; 8.4 estimated (nominal) 1.00 Effort adjustment factor 1. 17 DB Liu Software Cost Estimation 28
3.3~4 ALGORITHMIC COST MODELS (cont.) Total Cost of Project Personnel: Assume that the programmers and analysts cost $6,000 per PM, the total cost of project personnel will be: => DOLLARS = (66.8 PM)* ($ 6,000 per PM) = $ 400,800 COCOMO can also be used to investigate trade-offs in the development process by performing sensitivity analysis on the cost estimate. For example: Less capable personnel might be used to implement the telecommunications processor at a cost savings of $1,000 per programmermonth; however, the effort multipliers must both be increased from 0.86 to 1.0 to reflect the change. The effort adjustment factor becomes 1.58 and then Adjusted PM = PM * 1.58 = 57.1 * 1.58 = 90.2 programmer-months (more) Adjusted-TDEV = TDEV* 1.58 = 8.4*1.58 = 13.3 months (longer) => DOLLARS = $5,000 * 90.2 = $ 451,000 (a cost increase of $50,200). DB Liu Software Cost Estimation 29
3~3,4 ALGORITHMIC COST MODELS (cont0) If we expand the memory from 46K to 96K for an additional $10,000. The storage multiplier will be reduced from 1.06 to 1.00, which results in a new cost adjustment factor of 1.10. We now have: Adjusted PM = PM * 1.10 = 57.1 * 1.10 = 62.8 programmer-months. Adjusted-TDEV = TDEV* 1.10= ~ 4* 1.10=9.24 months (shorter) > DOLLARS = $6,000 * 62.8 = $ 376,800 (lower) The total savings: $400,800 - project in a shorter time. $376,800 = $ 24,000 and can finish the Therefore, purchasing additional memory is a wise decision. DB Liu Software Cost Estimation 30
3.3.4 ALGORITHMIC COST MODELS (cont.) Advantage of COCOMO: The model can be used to gain insight into the cost factors within an - organization. Data can be collected and analyzed, new factors can be identified, and - the effort multipliers can be adjusted as necessary to calibrate COCOMO to the local environment. Disadvantage of COCOMO: Assumption of various independent effort multipliers is too strong. - In reality, varying one factor ofien implies that the other factors - should also be adjusted. DB Liu Software Cost Estimation 31
3.4 ESTIMATING SOFTWARE MAINTENANCE COSTS o Software maintenance typically requires 40% to 60% of total life-cycle effort. Maintenance activities include adding enhancements to the product, adapting the product to new processing environment, and correcting problems. Use the estimated number of delivered source instructions (DSI): @ Business data processing: 32 KDSI I maintenance programmer. @ Real-time or Aerospace Software System: 8 KDSI 10 KDSI I maintenance programmer. - DB Liu Software Cost Estimation 32
3.4 ESTIMATING SOFTWARE MAINTENANCE COSTS (cont,) Use ACTIVITY RATIO: Boehm suggests that maintenance effort can be estimated by use of an Activity Ratio. ACT = (DSI added + DSI modified) I)~ total PM m = Number of programmer-months required for maintenance PM d = Number of programmer-months required for development PMm = ACT *PMd An enhance version is: PM m = ACT * EAF * PM d where EAF is the effort adjusted factor for different effort multipliers. DB Liu Software Cost Estimation 33
o 3.5 SUMMARY Software cost estimation is one of the most difficult and error-prone task in software engineering. o Cost estimation techniques rely on historical data covering past performance. Most cost estimates are in terms of estimated number of source instructions in the product to be developed. o Expert Judgment and Algorithmic Prediction are two fundamental approaches to cost estimation. Delphi technique of cost estimation by a group of experts was described. o The principal features of COCOMO were presented. Techniques for estimating software maintenance costs were discussed. Data must be collected during current proj ects in order to estimate effort and schedule for future ones. DB Liu Software Cost Estimation 34