Upload
melanie-todd
View
224
Download
1
Tags:
Embed Size (px)
Citation preview
1
Topic 5
PPlanning III lanning III –– EEstimating stimating SSoftware oftware SSizeize
2Topic 5 Planning III—Estimating Software Size
Lecture Overview
5.1 Background 5.2 Popular Estimating Methods 5.3 Proxy-based Estimating 5.4 The PROBE Size Estimating Method5.5 Object Categories 5.6 Estimating Considerations 5.7 Summary5.8 Exercises
3Topic 5 Planning III—Estimating Software Size
5.1 Background5.1 Background
4Topic 5 Planning III—Estimating Software Size
5.1 Background 1
Why Estimate Size? Size estimates allow you to make better plans.
Plan better for the resources, tasks, and schedule. The quality of a plan depends on that of the size estimate.
The more details you have, the more accurate the estimation will be. For a large software job, divide it into separate elements.
Size estimates assist you in tracking progress.
You can judge when the job scope changes. better measure the work.
5Topic 5 Planning III—Estimating Software Size
Background 2
Estimating models in other fields have a large historical base. are widely used. generate detailed planning data. require a size estimate as input.
6Topic 5 Planning III—Estimating Software Size
Project Planning Framework
The framework is shown in Figure 5.1. Size estimating: compare the design
elements with the historical size data to make estimates.
Accurate size estimation will lead to accurate resource estimation.
7Topic 5 Planning III—Estimating Software Size
Fig. 5.1 Project Planning Framework
CustomerNeed
Delivered Product
Customer
Define theRequirements
Produce theConceptual
Design
Estimate theProduct Size
(Topic 5)
Estimate theResources
(Topic 6)
Produce theSchedule
(Topic 6)
Develop theProduct
ProcessAnalysis
ResourcesAvailable
HistoricalProductivity
Database
HistoricalSize
Database
TrackingReports
Items
Tasks
Size, Resource, Schedule
data
Management
8Topic 5 Planning III—Estimating Software Size
Estimating Experience
Studies show that size estimation errors may be as high as 100% or even
more. Only 22% professionals make size estimates for cost
estimates. For software development, usually people have a larger
estimation error percentage (up to 400%) in early phase, and then the percentage declines (25% or less) in later phases.
Serious size estimation errors result in poor resource estimates and unrealistic project schedules.
Fortunately, the size estimation skill can be learned and improved.
9Topic 5 Planning III—Estimating Software Size
Size Estimating Criteria
A widely used method should be structured and trainable. usable during all development and maintenance
phases. usable for all types of software product elements. suitable for statistical analysis. adaptable to the types of your future work. able to judge the accuracy of the estimates.
10Topic 5 Planning III—Estimating Software Size
Size Estimating Principles 1
Estimating is an uncertain process. No one knows how big the product will be The earlier the estimate, the less is known Estimates can be biased by business and
other pressures (sometimes called ‘‘gutless’’ estimations)
Estimating is an intuitive learning process. Ability improves with experience Some people are better at estimating
11Topic 5 Planning III—Estimating Software Size
Size Estimating Principles2
Estimating is a skill. Improvement will be gradual You may never get very good
The objective, however, is to get consistent -- at least “unbiased.” You will then understand the variability
of your estimates You seek an even balance between
under and over estimates
12Topic 5 Planning III—Estimating Software Size
Size Estimating Errors - 12 Students
-200
-100
0
100
200
300
400
500
1 2 3 4 5 6 7 8 9 10
Program Number
% E
rro
r
Max
Class
Min
13Topic 5 Planning III—Estimating Software Size
Size Estimating Principles 3
The principal advantages of using a defined estimating method are: You have known practices that you can work to
improve. It provides a framework for gathering estimating
data. By using consistent methods and historical data,
your estimates will get more consistent.
14Topic 5 Planning III—Estimating Software Size
5.2 Popular Size Estimating 5.2 Popular Size Estimating MethodsMethods
15Topic 5 Planning III—Estimating Software Size
5.2 Popular Size Estimating Methods
Four popular methods Wideband-Delphi Fuzzy-Logic Standard-Component Function-Point
Their concepts form the foundation of the PROBE (Proxy-based Estimating) method used with the PSP.
16Topic 5 Planning III—Estimating Software Size
Wideband-Delphi Method 1
Originated by Rand Co. and refined by Boehm. Based on the Delphi process, which usually contains several
cycles. Several experts (estimators) and a moderator are involved in
the process. Each expert makes an independent estimate and submit it to
the moderator in each cycle. The moderator coordinates the estimation process for these
experts whose estimates are anonymous to all others. The process runs until experts’ estimates converge on a
consensus result.
17Topic 5 Planning III—Estimating Software Size
Wideband-Delphi Method 2
The method’s process is as follows:1. A group of experts is each given the program’s
specifications and estimation forms.
2. They meet to discuss project goals, assumptions, and estimation issues.
3. They then each anonymously list project tasks and estimation size.
4. The estimates are given to the moderator, who tabulates the results and returns them to the experts, as illustrated in Figure 5.2.
18Topic 5 Planning III—Estimating Software Size
Fig. 5.2 The Chart Used in Wideband-Delphi
0
Project: XYZEstimator: John DoeDate:4/1/94Here is the range of estimates from the 1st round:
20 40 60 80 100
X X* X! X X
X - estimatesX* - your estimateX! – median estimatePlease enter your estimate for the next round: ___SLOC.Please enter explain rationale for your estimate.
19Topic 5 Planning III—Estimating Software Size
Wideband-Delphi Method 3
5. Only each expert’s personal estimate is identified; all others are anonymous.
6. The experts meet to discuss the results. They each review the tasks they have defined but not their size estimates.
7. The cycle continues at step 3 until the estimates converge to within an acceptable range.
20Topic 5 Planning III—Estimating Software Size
Delphi Example 1
3 estimators are asked to estimate the product. Their initial estimates are:
A - 13,800 LOC B - 15,700 LOC C - 21,000 LOC
The coordinator then Calculates average estimate as 16,833 LOC Returns this with their original estimates to the
estimators
21Topic 5 Planning III—Estimating Software Size
Delphi Example 2
The estimators then meet and discuss the estimates.
Their second estimates are A - 18,500 LOC B - 19,500 LOC C - 20,000 LOC
The coordinator then Calculates average estimate as 19,333 LOC Asks the estimators if they agree with this as the
estimate
22Topic 5 Planning III—Estimating Software Size
Wideband-Delphi Method 4
Advantages can produce accurate results uses organization’s skills works for any size products.
Disadvantages relies on a few experts time consuming subject to common biases
23Topic 5 Planning III—Estimating Software Size
Fuzzy-Logic Method 1
Estimators compare the planned program with prior programs and select the most appropriate size category.
Preparing for this method gather sufficient size data on previously developed
programs subdivide these data into size categories and
subcategories provide a meaningful number of program examples in
each size category and subcategory extend the size ranges up or down as you get further data
Table 5.1 shows the example.
Table 5.1 Example for Fuzzy-Logic Method
Subrange
Gross
Range
Very small
LOC
Small
LOC
Medium
LOC
Large
LOC
Very Large
LOC
Very small 1,1,48 1,514 2,000 2,630 3,467
Small 4,570 6,025 8,000 10,471 13,804
Medium 18,197 23,988 32,000 41,687 54,954
Large 72,444 95,499 128,000 165,958 218,776
Very Large 288,403 380,189 512,000 660,693 870,964
25Topic 5 Planning III—Estimating Software Size
Fuzzy-Logic Method 2
Advantages based on relevant historical data easy to use requires no special tools or training provides reasonably good estimates in cases
where new work is like prior experience
26Topic 5 Planning III—Estimating Software Size
A Fuzzy Logic Example 1
You have historical data on 5 programs as follows: a file utility of 1,844 LOC a file management program of 5,834 LOC a personnel record keeping program of 6,845
LOC a report generating package of 18,386 LOC an inventory management program of 25,943
LOC
27Topic 5 Planning III—Estimating Software Size
A Fuzzy Logic Example 2
You establish 5 ranges, as follows log(1844) = 3.266 log(25,943) = 4.414 the difference is 1.148 1/4th this difference is 0.287 the logs of the five ranges are thus spaced
0.287 apart the limits or these ranges are at 0.1435
above and below the midpoint of each range
28Topic 5 Planning III—Estimating Software Size
A Fuzzy Logic Example 3
The 5 size ranges are thus: very small - 1,325 to 2,566: file utility small - 2,566 to 4970: no members medium - 4,970 to 9,626: file management and
personnel record program large - 9,626 to 18,641: report generator very large - 18,641 to 36,104: inventory
management
29Topic 5 Planning III—Estimating Software Size
A Fuzzy Logic Example 4
Your new program has the following requirements: analyze marketing performance by product
line project the likely sales in each product
category allocate these sales to marketing regions and
time periods produce a monthly report of these projections
and the actual results
30Topic 5 Planning III—Estimating Software Size
A Fuzzy Logic Example 5
In comparing the new program to the historical data you make the following judgments: substantially more complex application than the file
management and personnel programs not as complex as the inventory management
program. appears to have significantly more function than the
report package. You conclude that the new program is in the lower
end of “very large,” or from 18 to 25 KLOC.
31Topic 5 Planning III—Estimating Software Size
Fuzzy Logic - Summary
To make a fuzzy logic estimate:
1 - Divide the historical product size data into size ranges.
2 - Compare the planned product with these prior products.
3 - Based on this comparison, select the size that seems most appropriate for the new product.
32Topic 5 Planning III—Estimating Software Size
Fuzzy-Logic Method Disadvantages
Fuzzy logic estimating requires a lot of data requires that the estimators be familiar with the
historically developed programs provides only a crude sizing not useful for new program types not useful for programs that are much larger or
smaller than the historical data
33Topic 5 Planning III—Estimating Software Size
Standard-Component Method 1
Use organization’s historical data to determine the typical size of various types of components subsystems, modules, screens, reports, etc.
For a new project Judge the number of each type of components will
likely be in the project. Also determine the maximum and minimum
numbers of each type of components you could image.
34Topic 5 Planning III—Estimating Software Size
Standard-Component Method 2
Calculate the estimated number of each type with (4*likely number + max. number + min. number) / 6
The estimated size of each type is its estimated number * its typical size from historical
data Sum up the estimated size of all types to get the
total size.
Table 5.2 Example of Component Estimating
For modules, its estimated size = 932 * 17.5 = 16310.
Standard ComponentSLOC per
ComponentS M L
X=
(S+4*M+L)/6SLOC
SLOC 1
Object Instructions 0.28
Files 2,535 3 6 10 6.17 15,633
Modules 932 11 18 22 17.5 16,310
Subsystems 8,175
Screens 818 5 9 21 10.3 8,453
Report 967 2 6 11 6.17 5,963
Interactive Programs 1,769
Batch Programs 3,214
Total 46,359
36Topic 5 Planning III—Estimating Software Size
Standard-Component Method 3
Advantages based on relevant historical data easy to use requires no special tools or training provides a rough estimate range
Disadvantages must use large components early in a project limited data on large components hard to visualize component counts early in a
project
37Topic 5 Planning III—Estimating Software Size
Function-Point Method 1
Count the numbers of the 5 types of basic functions that the commercial application program will likely need by reviewing its requirements. Inputs: screens or forms through which to add new data or
update existing data in the application Outputs: screens or reports that the application produces Inquires: screens used to ask for interrogation, assistance or
information Data files: logical collection of records that the application
updates Interface: e.g., files shared with other applications, shared
databases, parameter lists, …
38Topic 5 Planning III—Estimating Software Size
Function-Point Method 2
Each type has a given weight. Calculate the function points of the
application multiply the number of each type by its weight. sum them up to get the total (unadjusted).
Use historical data on development cost and time per function point to make the estimates.
39Topic 5 Planning III—Estimating Software Size
Table 5.3 Function-Point Categories
Basic Counts
Function Type Weights Total
Inputs ×4
Outputs ×5
Inquiries ×4
Logical Files ×10
Interfaces ×7
Unadjusted Total
Table 5.4 Function-Point Category Example
Basic Counts
Function Type Weights Total
8 Inputs 8 ×4 32
12 Outputs 12 ×5 60
4 Inquiries 4 ×4 16
2 Logical Files 2 ×10 20
1 Interfaces 1 ×7 7
Unadjusted Total
135
41Topic 5 Planning III—Estimating Software Size
Function-Point Method 3
To improve the estimation, adjust the function points by 14 influence factors. The influence factor values are selected from 0
(very simple) to 5 (very complex) by the judgment of the estimator.
Sum up these values. Calculate the complexity multiplier
0.65+0.01*(sum of influence factor values) Calculate adjusted function points
complexity multiplier * unadjusted function points The adjustment is between ±35% Table 5.5 shows an example.
42Topic 5 Planning III—Estimating Software Size
Table 5.5 An Example of Function-Point Influence Factors
Factor Influence
Data Communications 2
Distributed Functions 0
Performance objectives 3
Heavily used configuration 3
Transaction rate 4
On line data entry 4
End-user efficiency 3
On line update 2
Complex processing 3
Reusability 2
Installation ease 3
Operational ease 4
Multiple sites 5
Facilitate change 3
Sum of influence factors = 41
0.65+0.01*(sum of Influence Factors)=Complexity Multiplier= 1.06
Function Points=Complexity Multiplier*Unadjusted Function Points= 143
43Topic 5 Planning III—Estimating Software Size
Function-Point Method 4
Advantages a well-documented method usable in the earliest requirements phase independent of programming languages, product
designs, development styles having a large body of historical data with an active user group
44Topic 5 Planning III—Estimating Software Size
Function-Point Method 5
Disadvantages cannot directly count an existing product’s
function point content without historical data, difficult to improve
estimating skill not reflect language, design, and style differences designed for estimating commercial data
processing applications
45Topic 5 Planning III—Estimating Software Size
5.3 Proxy-based Estimating 5.3 Proxy-based Estimating (PROBE)(PROBE)
46Topic 5 Planning III—Estimating Software Size
5.3 Proxy-Based Estimating (PROBE)
In stead of direct estimating, a proxy is a substitute to help estimators judge product size. Proxies, for example, can be objects, screens,
files, scripts, document chapters, function points, and so on.
47Topic 5 Planning III—Estimating Software Size
Criteria for a Good Proxy 1
The proxy size measurement (or estimate) should closely relate to the effort required to develop the product. Use the correlation method (see Topic 15) to determine
which proxy is a better predictor of product size or development effort.
48Topic 5 Planning III—Estimating Software Size
Criteria for a Good Proxy 2
The proxy content of a product should be automatically countable. Large amount of proxy data extracted from historical
data is needed to define new estimates. The proxy must be a physical entity that can be
precisely defined and algorithmically identified.
49Topic 5 Planning III—Estimating Software Size
Criteria for a Good Proxy 3
The proxy should be easy to visualize at the beginning of a project.
The proxy should be customizable to the special need of using organizations. Different product types may use different kind of
proxies to estimate. The proxy should be sensitive to any implementation
variations that impact development costs or efforts. for example, program languages, design styles,
application types
50Topic 5 Planning III—Estimating Software Size
Objects as Proxies 1
Objects in OO programming languages are a good candidate as proxies because they closely relate to development effort or resources. Figures 5.3 and 5.4 show close correlation between
estimated object LOC (=Σobject size ) and actual program LOC. Linear regression formula: (See Topic 15 )
actual program LOC = β0 + estimate object LOC * β1
Figures 5.5 and 5.6 show high correlation and significance between estimated object LOC and actual development hours. Linear regression formula:
actual development hours = β0 + estimate object LOC * β1
51Topic 5 Planning III—Estimating Software Size
Objects as Proxies 2
The PROBE method uses objects as proxies.
The PROBE method requires that estimators have historical data on the sizes of objects they have developed and that these data be divided into categories.
52Topic 5 Planning III—Estimating Software Size
Fig. 5.3 Estimated Object LOC vs. Actual Program LOC (10 Pascal Programs)
0 100 200 300 400 500 600 700 800 900 1000
2000
1800
1600
1400
1200
1000
800
600
400
200
0
Act
ual
Pro
gram
L
OC
Estimated Object LOC
53Topic 5 Planning III—Estimating Software Size
Fig. 5.4 Estimated Object LOC vs. Actual Program LOC (25 C++ Programs)
0 50 100 150 200 250 300 350
800
Act
ual
Pro
gram
L
OC
Estimated Object LOC
700
600
500
400
300
200
100
0
54Topic 5 Planning III—Estimating Software Size
Fig. 5.5 Estimated Pascal Object LOC vs. Actual Development Hours with Correlation 0.934, Significance < 0.005
0 100 200 300 400 500 600 700 800 900 1000
200
180
160
140
120
100
80
60
40
20
0
Act
ual
Dev
elop
men
t H
ours
Estimated Object LOC
55Topic 5 Planning III—Estimating Software Size
Fig. 5.6 Estimated C++ Object LOC vs. Actual Development Hours with Correlation 0.980, Significance < 0.005
0 50 100 150 200 250 300 350
60A
ctu
al D
evel
opm
ent
Hou
rs
Estimated Object LOC
50
40
30
20
10
0
56Topic 5 Planning III—Estimating Software Size
Estimating Object Size with Fuzzy-Logic Method
Judge the size of each object on a per-object’s method basis with fuzzy-logic method.
1. decide the category of the object2. judge how many methods it likely will contain3. decide the size range it falls into4. estimated object size = (# of methods) * (LOC of the
size range) Table 5.6 shows object category sizes in LOC per-
object’s method For example, a medium-sized Pascal text object with
4 methods has about 66 (=16.48*4) LOC.
57Topic 5 Planning III—Estimating Software Size
Table 5.6 Object Category Sizes in LOC per Method
C++ Object Size in LOC per Method
CategoryVery
SmallSmall Medium
Large
Very
Large
Calculation
2.34 5.13 11.25 24.66 54.04
Data 2.60 4.79 8.84 16.31 30.09
I/O 9.01 12.06 16.15 21.62 28.93
Logic 7.55 10.98 15.98 23.25 33.83
Set-up 3.88 5.04 6.56 8.53 11.09
Text 2.75 8.00 17.07 36.41 77.66
Object Pascal Object Size in LOC per Method
CategoryVery
Small
Small Medium LargeVery
Large
Control 4.24 8.68 17.79 36.46 74.71
Display 4.72 6.35 8.55 11.50 15.46
File 3.30 6.23 11.74 22.14 41.74
Logic 6.41 12.42 24.06 46.60 90.27
Print 3.88 5.86 10.15 17.59 30.49
Text 4.63 8.73 16.48 31.09 58.62
58Topic 5 Planning III—Estimating Software Size
5.4 The PROBE Size 5.4 The PROBE Size Estimating MethodEstimating Method
59Topic 5 Planning III—Estimating Software Size
5.4 The PROBE Size Estimating Method
The PROBE size estimating procedure is shown in Figure 5.7.
In the procedure, a size estimating template, shown in Table 5.7, will be used.
Use the template to instruct how to estimate program size with the PROBE method and linear regression.
60Topic 5 Planning III—Estimating Software Size
Fig. 5.7 The Procedure of PROBE Method
Start
Step 1:Conceptual
design
Step 3:Calculate projected and
modified LOC.
Step 4:Estimate
program size.
Step 5:Calculate
prediction interval.
Number ofmethods
Objecttype
Relativesize
Reusecategories
Step 2:Identify object
Size Estimate
Table 5.7 Size Estimating Template and example 1
Table 5.7 Size Estimating Template and example 2
63Topic 5 Planning III—Estimating Software Size
Size Estimating Template 1
Base Program: the program you will enhance and perform any changes to it. Base Size (B): the LOC of the base program LOC Deleted (D): the LOC to be deleted from the
base program LOC Modified (M): the LOC to be modified in the
base program
64Topic 5 Planning III—Estimating Software Size
Size Estimating Template 2
Projected LOC (P): includes total base additions LOC (BA) and total new objects LOC (NO) Base Additions: the new functions to be added to the
base program New Objects: the new objects to be added to the base
program New Reused Objects: a new object planned to develop
and general enough to put into the reuse library (Note: mark an * with the new reused objects)
Reused Objects (R): the objects taken from the reuse library
65Topic 5 Planning III—Estimating Software Size
Size Estimating Template 3
Calculations Using actual new and changed LOC and estimated
Object LOC (i.e., P+M) from historical data to obtain regression parameters β0, β1
Estimated New and Changed LOC (N): use regression parameters to calculate
N = β0 +β1 * (P + M) Estimated Total LOC (T): the estimated size of the
final program
66Topic 5 Planning III—Estimating Software Size
Size Estimating Template 4
Prediction Range: using t distribution (See Section 15.5.2), a desired prediction interval percent, and the data for linear regression to calculate
Lower/Upper Prediction Interval: the interval (N ± Range) within which the actual new and changed LOC is likely to fall
Prediction Interval Percent: the percentage that the actual new and changed LOC is likely to fall within the interval
67Topic 5 Planning III—Estimating Software Size
PROBE Step 1 – Conceptual Design
The conceptual design establishes a preliminary design approach and names the expected product objects and their functions.
For an accurate estimate, estimators must refine the conceptual design to the level of objects.
68Topic 5 Planning III—Estimating Software Size
PROBE Step 2 – Identify Objects
Determine object type and size if it is a new object, use fuzzy-logic method (see
Section 5.3) # of methods (judging size using a per-method basis) object type relative size LOC per method estimated object size = (# of method) * (LOC per method)
(Note: mark an * with the new reused objects) if the object is taken from the reuse library, determine
reuse object categories object LOC
69Topic 5 Planning III—Estimating Software Size
PROBE Step 3 – Calculate Projected and Modified LOC
Projected LOC (P) = Total Base Additions LOC (BA) +
Total New Objects LOC (NO) Using actual new and changed LOC and
estimated object LOC (i.e., P+M) from historical data to obtain regression parameters β0, β1
Estimated New and Changed LOC (N) = β0 +β1 * (P+M)
70Topic 5 Planning III—Estimating Software Size
PROBE Step 4 – Estimate Program Size
Estimated program size = Base Size (B) + Estimated New and Changed LOC (N) + Reused Total LOC (R) – LOC Deleted (D) – LOC Modified (M)
LOC Modified (M) is subtracted because it is counted twice: one in Base Size (B) and the other in Estimated New and Changed LOC (N).
71Topic 5 Planning III—Estimating Software Size
PROBE Step 5 – Calculate Prediction Interval 1
The purpose is to assess the quality of the estimate. Use t distribution, a desired prediction interval
percent, and the data for linear regression calculation to get Prediction Range Prediction Interval [LPI, UPI]
Within the prediction interval, the actual new and changed LOC is likely to fall with the selected percent.
72Topic 5 Planning III—Estimating Software Size
PROBE Step 5 – Calculate Prediction Interval 2
Prediction Interval: [LPI, UPI] Lower Prediction Interval (LPI) =
Estimated New and Changed LOC (N) - Range Upper Prediction Interval (UPI) =
Estimated New and Changed LOC (N) + Range
73Topic 5 Planning III—Estimating Software Size
PROBE Step 5 – Calculate Prediction Interval 3 Prediction Range: using the data for linear
regression calculation in Step 3
Where xi is the estimated object LOC (i.e., P+M) in historical dataxavg is the average of xi
xk is the estimated object LOC (i.e., P+M) in the new programyi is actual new and changed LOC in historical data
niavgi
avgk
xx
xx
nntRange
..1
2
2
)(
)(11)2,2/(
n
iii xy
nVariance
1
210
2 )()2
1(
74Topic 5 Planning III—Estimating Software Size
5.5 Object Categories5.5 Object Categories
75Topic 5 Planning III—Estimating Software Size
5.5 Object Categories
The PROBE method uses objects as proxies. It needs object categories and their sizes to judge the size of the new objects.
Table 5.6 shows the example that we want to produce.
for C++ and Object Pascalobject sizes per method are divided into 5 size
ranges: very small, small, medium, large, and very large.
76Topic 5 Planning III—Estimating Software Size
Object Size Distribution
Assume historical object data are normally distributed.
Figure 5.8 shows the relation between the normal distribution and the size ranges.
77Topic 5 Planning III—Estimating Software Size
Fig. 5.8 Normal Distribution with Size Ranges
σ
78Topic 5 Planning III—Estimating Software Size
Approaches
Two approaches If the size data are close to normal distribution,
use normal distribution in the calculation . Otherwise, use normal distribution of natural log in
the calculation.
79Topic 5 Planning III—Estimating Software Size
Approach I: Procedure with Original Data
Use historical data on objects divide them into categories calculate the size range midpoints for each
category. use statistical techniques of normal distribution in the
calculation
The following is the procedure:
80Topic 5 Planning III—Estimating Software Size
Step 1: Classification
Divide objects in historical data into categories.
Basic object categories logic, control I/O, files, display data, text, calculation set-up, error handling
81Topic 5 Planning III—Estimating Software Size
Step 2: Calculating LOC per Method
For each category, calculate the LOC per method of each object.
Table 5.9 shows the example for 13 objects belonging to the object category, text.
82Topic 5 Planning III—Estimating Software Size
Table 5.8 Pascal Text Object LOC per Method
Object Name Number of Methods Object LOC LOC per Method
each_line 3 31 10.333
each_char 3 18 6.000
list_clump 4 87 21.750
character 3 87 29.000
single_character 3 25 8.333
single_read 3 18 6.000
list_clp 4 89 22.250
char 3 85 28.333
single_char 3 37 12.333
converter 10 558 55.800
string_manager 4 82 20.500
string_builder 5 82 16.400
string_decrementer 10 230 23.000
83Topic 5 Planning III—Estimating Software Size
Step 3: Calculating Standard Deviation
For each category, calculate the variance and standard deviation of the values from Step 2. Variance = σ2 = (1/n) ∑i=1..n(xi – xavg )2
Standard Deviation = √ of Variance =σ
where xi = (LOC per method) of each object of one specific category; xavg denotes the average.
The following table shows the example.
84Topic 5 Planning III—Estimating Software Size
Table 5.9 Pascal Text Object Standard Deviation
Object Name LOC per Method (LOC-LOCavg)2
each_line 10.333 93.249
each_charr 6.000 196.072
list_clump 21.750 3.054
chracter 29.000 80.954
single_character 8.333 136.171
single_read 6.000 196.072
list_clp 22.250 5.051
char 28.333 69.402
single_char 12.333 58.817
converter 55.800 1281.456
string_manager 20.500 0.247
string_builder 16.400 12.978
string_decrementer 23.000 8.985
Total 260.033 2142.753
Average 20.003
Variance=Total/n = 164.827
Standard Deviation = 12.839Variance
2
85Topic 5 Planning III—Estimating Software Size
Step 4: Calculating Size Range Midpoints
For each category, use the average xavg and standard deviation σ to calculate the size range midpoints VL = xavg + 2σ
L = xavg + σ
M = xavg
S = xavg – σ
VS = xavg - 2σ
86Topic 5 Planning III—Estimating Software Size
Negative Size Range Midpoints
Table 5.10 shows the example of the size range midpoints and the 13 object sizes per method.
However, in this example, the VS midpoint is a negative number, which is not what we want and means that the object data are not normally distributed.
87Topic 5 Planning III—Estimating Software Size
Table 5.10 Pascal Text Object and Size Ranges
Size Ranges Range Midpoint
LOC
Object
LOC/Method
VS -5.68
6.000
6.000
S 7.16
8.333
10.333
12.333
16.400
M 20.00
20.500
21.750
22.250
23.000
28.333
29.000
L 32.84
VL 45.68
55.800
88Topic 5 Planning III—Estimating Software Size
Approach II: Procedure with Natural Log of Original Data
The trick to handle the negative size range midpoint is to calculate the natural log of the data.
The following is the procedure with the first 2 steps same as the previous procedure.
89Topic 5 Planning III—Estimating Software Size
Step 3: Calculating the Natural Log and Average
For each category, calculate the natural log (ln) of the LOC per method of each object, and the average, avgln, of these log values.
Table 5.11 is the example for object category, text.
90Topic 5 Planning III—Estimating Software Size
Table 5.11 Pascal Text Object ln (LOC per Method)
Object Name LOC per Method In (LOC per Method) (In LOC-In LOCavg)2
each_line 10.333 2.335 0.2173
each_charr 6.000 1.792 1.0196
list_clump 21.750 3.080 0.0773
chracter 29.000 3.367 0.3201
single_character 8.333 2.120 0.4641
single_read 6.000 1.792 1.0196
list_clp 22.250 3.102 0.0905
char 28.333 3.344 0.2943
single_char 12.333 2.512 0.0836
converter 55.800 4.022 1.4890
string_manager 20.500 3.020 0.0479
string_builder 16.400 2.797 0.0000
string_decrementer 23.000 3.135 0.1115
Total 260.033 36.419 5.2348
Average 20.003 2.802
Variance 164.827 0.4027
Standard Deviation 12.839 0.6346
InVL=2.802+1.269 4.071 VL=e4.071= 58.62
InL=2.802+.635 3.437 L=e3.437= 31.09
InM=2.802 2.802 M=e2.802= 16.48
InS=2.802-.635 2.167 S=e2.167= 8.73
InVS=2.802-1.269 1.533 VS=e1.533= 4.63
91Topic 5 Planning III—Estimating Software Size
Step 4: Calculating Standard Deviation
For each category, calculate the variance and standard deviation of these log values. Variance = σ2 = (1/n) ∑i=1..n(xi – xavg )2
Standard Deviation = √ of Variance =σ
where xi = ln (LOC per method) of each object of a category.
92Topic 5 Planning III—Estimating Software Size
Step 5: Calculating the Log of Size Range Midpoints
For each category, use average of log values and standard deviation to calculate the log of size range midpoints ln(VL) = avgln + 2σ
ln(L) = avgln + σ
ln(M) = avgln
ln(S) = avgln – σ
ln(VS) = avgln - 2σ
93Topic 5 Planning III—Estimating Software Size
Step 6: Calculating the Antilog
For each category, calculate the antilog to get the midpoints of the size ranges VL = eln(VL)
V = eln(L)
M = eln(M)
S = eln(S)
VS = eln(VS)
Table 5.12 shows the example of the size range midpoints and the 13 object sizes per method.
94Topic 5 Planning III—Estimating Software Size
Table 5.12 Pascal Text Objects and Size Ranges
Size Ranges Range Midpoint LOC Object LOC/Method
VS 4.63
6.000
6.000
8.333
S 8.73
10.333
12.333
16.400
M 16.48
20.500
21.750
22.250
23.000
28.333
29.000
L 31.09
55.800
VL 58.62
95Topic 5 Planning III—Estimating Software Size
5.6 Estimating Considerations5.6 Estimating Considerations
96Topic 5 Planning III—Estimating Software Size
5.6 Estimating Considerations 1
The PSP estimating objective is to improve your estimating ability by tracking and analyzing your estimates.
If your estimating process is stable, the linear regression method, based on the historical data gathered from consistently biased estimates, can make an accurate bias adjustment.
While you gain more experience and your process evolves, you should adjust your statistical calculations to include only the newer and more representative data and drop the old ones.
97Topic 5 Planning III—Estimating Software Size
Estimating Considerations 2
Whenever your linear regression parameters appear unreasonable (e.g., β1 far from 1.0, large β0 ), use the averaging method to estimate. This method uses a ratio to adjust size or time
based on historical averages. estimated program LOC = estimated object LOC * ratio
where ratio = historical average =
∑(final program LOC) / ∑ (estimated object LOC)
98Topic 5 Planning III—Estimating Software Size
Estimating Considerations 3
To use the linear regression method, you must have at least three programs for which you have made object LOC estimates.
If you have at least three programs but enough historical estimate data, obtain β0 and β1 from your actual size data
If you do not have enough historical data but at least one program, use the averaging method
99Topic 5 Planning III—Estimating Software Size
Estimating Considerations 4
You can learn to reduce the estimating bias by comparing, during postmortem, estimates made at each phase with their actual size.
To estimate unprecedented products, the best answer is to resist making firm estimates until you have completed a feasibility study and build some prototypes.
100Topic 5 Planning III—Estimating Software Size
5.7 Summary5.7 Summary
101Topic 5 Planning III—Estimating Software Size
5.7 Summary 1
Accurate size estimate will help you to make better development plans.
Size estimating skill improve with practice. A defined and measured process provides a
repeatable basis for improvement.
102Topic 5 Planning III—Estimating Software Size
Summary 2
With PROBE, estimates are based on one of following four methods:
Method A: regression with estimated object LOCMethod B: regression with estimated new and
changed LOCMethod C: size or time adjustment based on
historical averages (the averaging method)Method D: engineering judgment
103Topic 5 Planning III—Estimating Software Size
Summary 3
Method A: regression with estimated object LOC
use the relationship between estimated object LOC and
actual new and changed LOC actual development time
The criteria for using this method are3 or more data points that are correlated (r2 > 0.5)Reasonable regression parameters
104Topic 5 Planning III—Estimating Software Size
Summary 4
Method B: regression with estimated new and changed LOC
use the relationship between estimated new and changed LOC and
actual new and changed LOC actual development time
The criteria for using this method are3 or more data points that are correlated (r2 > 0.5)Reasonable regression parameters
105Topic 5 Planning III—Estimating Software Size
Summary 5
Method C: adjusting size or time based on historical averages.
the averaging methodeasy to useused when linear regression parameters (β0, β1)
appear unreasonable (that is, methods A and B can not be used)
assuming that there is no fixed overhead The criteria for using this method are
At least one data point is required.
106Topic 5 Planning III—Estimating Software Size
Summary 6
Method D: engineering Judgment with estimated object LOC
used in absence of historical datausing judgment from estimated object LOC to
estimate actual new and changed LOC actual development time
used when methods A, B, and C can not be used
107Topic 5 Planning III—Estimating Software Size
5.8 Exercises5.8 Exercises
108Topic 5 Planning III—Estimating Software Size
Program 3A 1
Use PSP0.1 (see Appendix in Topic 4) to write program 3A.
Program 3A Requirements: Write a program to count
the total program LOC the total LOC in each object the number of methods in each object
If an object-oriented program is not used as the input, count the total program LOC the total LOC in each procedure or function
109Topic 5 Planning III—Estimating Software Size
Program 3A 2
Use the counting standard produced by report exercise R1.
It is acceptable to enhance program 2A or to reuse some of its methods, procedures, or functions in developing this program.
Program 3A Testing: Thoroughly test the program. At a minimum, test program 1A, 2A, and 3A. Prepare a test report that includes a table as the format
in Table 5.11. Produce a report on the defect fix times for programs
1A, 2A, and 3A.
Table 5.11 Test Result Format Program 3A
Program number
Object Name Number of Methods
Object LOC Total Program LOC
1A ABC 3 86
DEF 2 8
GHI 4 92
212
2A …
a) Format for object-oriented program designs
Program number
Procedure/
Function Name
Number of Methods
Procedure/
Function LOC
Total Program LOC
1A ABC 1 86
DEF 1 8
GHI 1 92
212
2A …
b) Format for non object-oriented program designs
111Topic 5 Planning III—Estimating Software Size
Order to Submit Assignment:
Cover sheet: Exercise #, Name, SID PSP0.1 Project Plan Summary PIP form, including lessons learned Time Recording Log Defect Recording Log Source program listing Report R1 LOC counting standard (if modified) Report R2 coding standard (if modified) Report R3 defect analysis report Test Results
Program 3A 3
112Topic 5 Planning III—Estimating Software Size
Program 4A 1
Use PSP1 (see Appendix in this topic) to write program 4A.
Program 4A Requirements: Write a program to calculate the linear regression
size-estimating parameters:
avgavg
n
iavgi
n
iavgavgii
xy
xnx
ynxyx
1
22
1
)(
113Topic 5 Planning III—Estimating Software Size
Program 4A 2
Use the historical data of a set of n programs: object LOC, xi, and new and changed LOC, yi.
Enhance the linked list of program 1A to hold the n data records, where each record has 2 real numbers.
114Topic 5 Planning III—Estimating Software Size
Program 4A 3
Program 4A Testing: Thoroughly test the program. At a minimum, test it with the 3 cases shown in Table
5.12: use the data for estimated object LOC and actual new and
changed LOC. use the data for estimated new and changed LOC and actual
new and changed LOC. use the data, estimated new and changed LOC and actual
new and changed LOC, you have gathered for the programs 2A, 3A and 4A you have developed.
Prepare a test report that includes a table as the format in Table 5.13.
Table 5.12 Size Estimating Regression Data
Program Number Estimated Object LOC Estimated New and Changed LOC
Actual New and Changed LOC
1 130 163 186
2 650 765 699
3 99 141 132
4 150 166 272
5 128 137 291
6 320 355 331
7 95 136 199
8 945 1206 1890
9 368 433 788
10 961 1130 1601
Sum 3828 4632 6389
Average 382.8 463.2 638.9
Table 5.13 Test Result Format Program 4A
Test Expected Results Actual Results
β0 Β1 Β0 Β1
Table D8:
Estimated Object versus
Actual New And Changed
LOC
-22.55 1.7279
Table D8:
Estimated New and Changed LOC versus Actual New and Changed LOC
-23.92 1.4310
Program 2A, 3A, 4A:
Estimated New LOC versus Actual New and Changed LOC
NA NA
117Topic 5 Planning III—Estimating Software Size
Appendix PSP 1Appendix PSP 1
118Topic 5 Planning III—Estimating Software Size
Report R3 RequirementsReport R3 Requirements
119Topic 5 Planning III—Estimating Software Size
Requirements for Report 3
The objectives of the defect analysis are to help you understand the Density and type of defects introduced and found
while developing programs. Importance of carefully gathering, recording, and
reporting process data.
120Topic 5 Planning III—Estimating Software Size
Report 3 Requirements 1
Analyze the defects found in development the initial programs.
Produce a report that includes these table. Defect density Compile and test phase defect density Average defect fix time by phase injected and
removed
121Topic 5 Planning III—Estimating Software Size
Report 3 Requirements 2
To prepare the defect analysis report, you will need the following project plan summary data for programs 1A through 3A. new and changed LOC defect injected and removed for each phase
From the defect logs, you will need counts and fix times for all defects. Injected in design and found in compile or test Injected in coding and found in compile or test Injected in design or coding founded in compile or test
122Topic 5 Planning III—Estimating Software Size
Example Defect Analysis Report 3 Defect Densities Compile and Test Defects
Program Number
New and Changed LOC
Total Defects Defects per KLOC
Defects found in compile
Compile defects per KLOC
Defects found in test
Test defects per KLOC
1 111 17 153 9 81 2 18
2 88 6 68 6 68 0 0
3 103 10 97 4 39 5 49
4 77 8 104 3 39 5 49
5 81 8 99 0 0 0 0
6 124 8 65 3 24 0 0
7 175 24 137 5 29 2 11
8 117 9 77 1 9 0 0
9 153 16 105 0 0 1 7
10 224 15 67 2 9 1 4
Totals 1253 121 97 33 26 11 9
123Topic 5 Planning III—Estimating Software Size
Example Defect Analysis Report 3
Defect Fix Times
Defects found in compiling
Defects found in testing
Total defects found
Defects injected in designing
Total fix time 1 137 256
Total defects 1 4 48
Average fix time
1 34 5
Defects injected in coding
Total fix time 93 9 122
Total defects 32 3 61
Average fix time
3 3 2
Total defects injected
Total fix time 94 159 444
Total defects 33 11 124
Average fix time
3 14 4
PSP1 Process Script 1
Phase Number
Purpose To guide you in developing module-level programs
Entry Criteria Problem descriptionPSP1 Project Plan Summary formSize Estimating TemplateHistorical estimate and actual size dataTime and Defect Recording LogsDefect Type StandardStop watch (optional)
1 Planning Produce or obtain a requirements statementUse the PROBE method to estimate the total new and changed LOC required.Complete the Size Estimating Template.Estimate the required development timeEnter the plan data in the Project Plan Summary formComplete the Time Recording Log
2 Development Design the programImplement the designCompile the program and fix and log all defects foundTest the program and fix and log all defects foundComplete the Time Recording Log
PSP1 Process Script 2
Phase Number
Purpose To guide you in developing module-level programs
3 Postmortem Complete the Project Plan Summary form with actual time and defect data
Exit Criteria A thoroughly tested programCompleted Project Plan Summary with estimated and actual dataCompleted Size Estimating TemplateCompleted Test Report TemplateCompleted PIP formsCompleted Defect and Time Recording Logs
PSP1 Planning Script 1
Phase Number
Purpose To guide the PSP planning process
Entry Criteria Problem descriptionPSP1 Project Plan Summary formSize Estimating TemplateHistorical estimate and actual size dataTime Recording Logs
1 Program Requirements
Produce or obtain a requirements statement for the program.Ensure the requirements statement is clear and unambiguous.Resolve any questions.
2 Size Estimate Produce a program conceptual design.Use the PROBE method to estimate the new and changed LOC required to develop this program.Estimate the base, added, deleted, modified, and reused LOC.Complete the Size Estimating Template and Project Plan Summary.
PSP1 Planning Script 2
Phase Number
Purpose To guide the PSP planning process
3 Estimate Resources
Based on the time required per LOC on previous programs, make your best estimate of the time required to develop this program.Using the To Date % from the most recently developed program as a guide, describe the development time over the planned project phases.
Exit Criteria A documented requirements statementThe program conceptual designCompleted Size Estimating TemplateA completed Project Plan Summary with estimated program size and development time dataCompleted Time Recording Logs
PSP1 Development Script 1
Phase Number
Purpose To guide the Development of small programs
Entry Criteria
Requirements statementProject Plan Summary with planned program size and development timeTime and Defect Recording LogsDefect Type Standard and Coding Standard
1 Design Review the requirements and produce a design to meet themRecord time in Time Recording Log
2 Code Implement the design following Coding StandardRecord in the Defect Recording Log any requirements or design defects foundRecord time in Time Recording Log
3 Compile Compile the program until error freeFix all defects foundRecord defects in the Defect Recording LogRecord time in Time Recording Log
PSP1 Development Script 2
Phase Number
Purpose To guide the Development of small programs
4 Test Test until all tests run without error.Fix all defects found.Record defects in the Defect Recording Log.Record time in Time Recording Log.Complete a Test Report Template on the tests conducted and results obtained.
Exit Criteria
A thoroughly tested program that conforms to the Coding StandardCompleted Test Report TemplateCompleted Defect and Time Recording Logs
Phase Number
Purpose To guide the PSP postmortem process
Entry Criteria
Problem description and requirements statementProject Plan Summary form with planned program size and development timeCompleted Test Report TemplateCompleted Time Recording LogsCompleted Defect Recording LogA tested and running program that conforms to the Coding Standard
1 Defects Injected
Determine from the Defect Recording Log the number of defects injected in each PSP1 phaseEnter this number under Defects Injected – Actual on the Project Plan Summary
2 Defects Removed
Determine from the Defect Recording Log the number of defects removed in each PSP1 phaseEnter this number under Defects Removed – Actual on the Project Plan Summary
3 Size Count the LOC in the completed program.Determine the base, reused, deleted, modified, added, total, total new and changed, and new reused LOC.Enter these data on the Project Plan Summary.
PSP1 Postmortem Script 1
Phase Number
Purpose To guide the PSP postmortem process
4 Time Review the completed Time Recording LogEnter the total time spent in each PSP1 phase under Actual on the Project Plan Summary form
Exit Criteria
A fully tested program that Conforms to the Coding StandardCompleted Test Report TemplateCompleted Project Plan Summary formCompleted PIP forms describing process problems, improvement suggestions, and lessons learned.Completed Defect and Time Recording Logs
PSP1 Postmortem Script 2
Size Estimating Template 1
Size Estimating Template 2
Test Report Template
PSP1 Project Plan Summary 1
PSP1 Project Plan Summary 2