Function Point Analysis and COCOMO
Function Point Analysis and COCOMO
2
Software Project Planning
3
Software Project Planning
Software planning begins before technical work starts, continues as
the software evolves from concept to reality, and culminates only
when the software is retired.
Size estimation
Resources
requirements
4
Software Project Planning
• Size Estimation Fig. 2: Function for sorting an array
1. int. sort (int x[ ], int n)
• Lines of Code (LOC) 2. {
5
Software Project Planning
1,000,000
500,000
0
Jan 1993 Jun 1994 Oct 1995 Mar 1997 Jul 1998 Dec 1999 Apr 2001
6
Software Project Planning
7
Software Project Planning
8
Software Project Planning
Function Count
Alan Albrecht while working for IBM, recognized the
problem in size measurement in the 1970s, and
developed a technique (which he called Function Point
Analysis), which appeared to be a solution to the size
measurement problem.
9
Software Project Planning
10
Software Project Planning
The FPA functional units are shown in figure given below:
User
Inquiries
Other
applications
Inputs ILF
EIF
User
Outputs ILF: Internal logical files
System EIF: External interfaces
13
Software Project Planning
Special features
14
Software Project Planning
15
Software Project Planning
Weighting factors
Functional Units
Low Average High
External Inputs (EI) 3 4 6
External Output (EO) 4 5 7
External Inquiries (EQ) 3 4 6
External logical files (ILF) 7 10 15
External Interface files (EIF) 5 7 10
16
Software Project Planning
Table 2: UFP calculation table
Functional Count Complexity Functional
Units Complexity Totals Unit Totals
External Low x 3 =
Inputs Average x 4 =
(EIs) High x 6 =
External Low x 4 =
Outputs Average x 5 =
(EOs) High x 7 =
External Low x 3 =
Inquiries Average x 4 =
(EQs) High x 6 =
External Low x 7 =
logical Average x 10 =
Files (ILFs) High x 15 =
External Low x 5 =
Interface Average x 7 =
Files (EIFs) High x 10 =
17
Software Project Planning
18
Software Project Planning
19
Software Project Planning
FP = UFP * CAF
20
Software Project Planning
Table 3 : Computing function points.
Rate each factor on a scale of 0 to 5.
0 1 2 3 4 5
21
Software Project Planning
Functions points may compute the following important metrics:
Productivity = FP / persons-months
Quality = Defects / FP
Cost = Rupees / FP
Documentation = Pages of documentation per FP
www.qsm.com/?q=resources/function-point-languages-table/index.html
22
Software Project Planning
Example: 4.1
23
Software Project Planning
Solution
We know 5 3
UFP = 50 x 4 + 40 x 5 + 35 x 4 + 6 x 10 + 4 x 7
= 200 + 200 + 140 + 60 + 28 = 628
CAF = (0.65 + 0.01 ΣFi)
= (0.65 + 0.01 (14 x 3)) = 0.65 + 0.42 = 1.07
FP = UFP x CAF
= 628 x 1.07 = 672
24
Software Project Planning
Example:4.2
An application has the following:
10 low external inputs, 12 high external outputs, 20 low
internal logical files, 15 high external interface files, 12
average external inquiries, and a value of complexity
adjustment factor of 1.10.
What are the unadjusted and adjusted function point counts ?
25
Software Project Planning
Solution
Unadjusted function point counts may be calculated using
as:
5 3
26
Software Project Planning
Example: 4.3
Consider a project with the following parameters.
(i) External Inputs:
(a)10 with low complexity
(b)15 with average complexity
(c) 17 with highcomplexity
(ii) External Outputs:
(a)6 with low complexity
(b)13 with high complexity
(iii) External Inquiries:
(a) 3 with low complexity
(b) 4 with average complexity
(c) 2 high complexity
27
Software Project Planning
(iv) Internal logical files:
(a)2 with average complexity
(b)1 with high complexity
(v) External Interface files:
(a) 9 with low complexity
In addition to above, system requires
i. Significant data communication
ii. Performance is very critical
iii. Designed code may be moderately reusable
iv. System is not designed for multiple installation in different
organizations.
Other complexity adjustment factors are treated as average. Compute
the function points for the project.
28
Software Project Planning
Solution: Unadjusted function points may be counted using table 2
Functional Count Complexity Complexity Functional
Units Totals Unit Totals
External 10 Low x 3 = 30
Inputs 15 Average x 4 = 60
(EIs) 17 High x 6 = 102 192
External 6 Low x 4 = 24
Outputs 0 Average x 5 = 0
(EOs) 13 High x 7 = 91 115
External 3 Low x 3 = 9
Inquiries 4 Average x 4 = 16
(EQs) 2 High x 6 = 12 37
External 0 Low x 7 = 0
logical 2 Average x 10 = 20
Files (ILFs) 1 High x 15 = 15 35
External 9 Low x 5 = 45
Interface 0 Average x 7 = 0
Files (EIFs) 0 High x 10 = 0 45
424
Total Unadjusted Function Point Count
29
Software Project Planning
14
∑F
i=1
i
= 3+4+3+5+3+3+3+3+3+3+2+3+0+3=41
Hence FP = 449
30
Example
Compute the function point, productivity, documentation, cost per
function for the following data:
1.Number of user inputs = 24
2.Number of user outputs = 46
3.Number of inquiries = 8
4.Number of files = 4
5.Number of external interfaces = 2
6.Effort = 36.9 pm (Person-Months)
7.Technical documents = 265 pages
8.User documents = 122 pages
9.Cost = $7744/ month
10.Various processing complexity factors are: significant, no
influence, no influence, Average, Average, Essential, Significant,
Significant, Average, Average, Moderate, Moderate, Significant,
Essential.
31
Function Point (FP) Line of Code (LOC)
32
Software Project Planning
Relative Cost of Software Phases
31
Software Project Planning
200
180
160
140
120
100 Cost
80
60
40
20
0
Req Des I nt
32
Software Project Planning
Cost Estimation
A number of estimation techniques have been developed and are
having following attributes in common :
➢ Project scope must be established in advance
➢ Software metrics are used as a basis from which estimates are made
➢ The project is broken into small pieces which are estimated individually
33
Software Project Planning
MODELS
34
Software Project Planning
Static, Single Variable Models
Methods using this model use an equation to estimate the desired
values such as cost, time, effort, etc. They all depend on the same
variable used as predictor (say, size). An example of the most
The Software Engineering
common equations is :
Laboratory of the University of
C=a Lb (i) Maryland has established a
C is the cost, L is the size and a,b are constants model, SEL model
E = 1.4 L0.93
DOC = 30.4 L0.90
D = 4.6 L0.26
Effort (E in Person-months), documentation (DOC, in number of
pages) and duration (D, in months) are calculated from the number
of lines of code (L, in thousands of lines) used as a predictor.
35
• The constants a and b are derived from the historical
data of the organization. Since a and b depend on the
local development environment, these models are not
transportable to different organizations.
38
Software Project Planning
Static, Multivariable Models
These models are depend on several variables representing various
aspects of the software development environment, for example
method used, user participation, customer oriented changes, memory
constraints, etc.
E = 5.2 L0.91 Model developed by Waltson and
Felix provide relationship between
D = 4.1 L0.36 LOC and effort
Example: 4.4
37
Software Project Planning
Solution
The amount of manpower involved = 8 PY = 96 person-months
(a) Number of lines of source code can be obtained by reversing equation to
give:
L = (E/a)1/b
L(SEL) = (96/1.4)1/0.93 = 94264LOC=94.264KLOC
38
Software Project Planning
(b) Duration in months can be calculated by means of equation
D(SEL) = 4.6 (L)0.26
= 4.6 (94.264)0.26 = 15 months
D(W-F) = 4.1 L0.36
= 4.1(24.632)0.36 = 13 months
(c) Productivity is the lines of code produced per person/month (year)
94264
P(SEL) = = 11783 LOC / Person − Years
8
24632
P(W − F ) = = 3079 LOC / Person − Years
8
39
Software Project Planning
96 P − M
M (SEL) = = 6.4Persons
15M
96 P − M
M (W − F ) = = 7.4Persons
13M
If we look at the value of “L”, it seems that SEL can produce four
times as much software as IBM for the same manpower and time
scale.
40
Software Project Planning
Model proposed by
B. W. Boehm’s
through his book
Software Engineering Economics in 1981
41
Software Project Planning
COCOMO applied to
Semidetached
Organic mode Embedded
mode mode
Organic Typically Small size project, experienced Little Not tight Familiar & In
developers in the familiar house
2-50 KLOC
environment. For example, pay
roll, inventory projects etc.
Embedded Typically over Large project, Real time Significant Tight Complex
systems, Complex interfaces, Hardware/
300 KLOC
Very little previous experience. customer
For example: ATMs, Air Traffic Interfaces
Control etc. required
43
Software Project Planning
Basic Model
Basic COCOMO model takes the form
E = a (KLOC)bb
b
D = cb (E) db
44
Software Project Planning
Software ab bb cb db
Project
45
Software Project Planning
When effort and development time are known, the average staff size
to complete the project may be calculated as:
E
Average staff size (SS) = Persons
D
46
Software Project Planning
Example: 4.5
47
Software Project Planning
Solution
The basic COCOMO equation take the form:
bb
E = ab (KLOC)
D = cb (KLOC) d b
Estimated size of the project = 400 KLOC
(i) Organic mode
E = 2.4(400)1.05 = 1295.31 PM
D = 2.5(1295.31)0.38 = 38.07 PM
48
Software Project Planning
49
Software Project Planning
Example: 4.6
50
Software Project Planning
Solution
E
Average staff size (SS) = Persons
D
1133.12
= = 38.67Persons
29.3
51
Software Project Planning
KLOC 200
Productivity = = = 0.1765 KLOC / PM
E 1133.12
P = 176 LOC / PM
52
Software Project Planning
Intermediate Model
Cost drivers
(i) Product Attributes
➢ Required s/w reliability
➢ Size of application database
➢Complexity of the product
(ii) Hardware Attributes
➢ Run time performance constraints
➢ Memory constraints
➢ Virtual machine volatility
➢ Turnaround time
53
Software Project Planning
(iii) Personal Attributes
➢ Analyst capability
➢ Programmer capability
➢ Application experience
➢ Virtual m/c experience
➢ Programming language experience
(iv) Project Attributes
➢ Modern programming practices
➢ Use of software tools
➢ Required development Schedule
54
Software Project Planning
Multipliers of different cost drivers
Cost Drivers RATINGS
Very low Low Nominal High Very Extra
high high
Product Attributes
55
Software Project Planning
Cost Drivers RATINGS
Very low Low Nominal High Very Extra
high high
Personnel Attributes
MODP --
1.24 1.10 1.00 0.91 0.82
TOOL 1.24 1.10 1.00 0.91 0.83 --
SCED
1.23 1.08 1.00 1.04 1.10 --
56
• Effort adjustment factor EAF is calculated using
multiplying factors for all 15 cost drivers.
60
Software Project Planning
Intermediate COCOMO equations
E = a (KLOC)bi * EAF
i
D = ci (E) d i
Project ai bi ci di
57
Software Project Planning
Detailed COCOMO Model
Detailed COCOMO
Cost Modules,
drivers design subsystem
& test System level
Manpower allocation for
each phase
58
Software Project Planning
Principle of the effort estimate
Size equivalent
As the software might be partly developed from software already
existing (that is, re-usable code), a full development is not always
required. In such cases, the parts of design document (DD%), code
(C%) and integration (I%) to be modified are estimated. Then, an
adjustment factor, A, is calculated by means of the following
equation.
A = 0.4 DD + 0.3 C + 0.3 I
The size equivalent is obtained by
S (equivalent) = (S x A) / 100
E p = p E
Dp = p D
61
Software Project Planning
Lifecycle Phase Values of p
Mode & Code Plan & System Detailed Module Integration
Size Requirements Design Design Code & Test & Test
Organic Small
0.06 0.16 0.26 0.42 0.16
S≈2
Organic
0.06 0.16 0.24 0.38 0.22
medium S≈32
Semidetached
0.07 0.17 0.25 0.33 0.25
medium S≈32
Semidetached
0.07 0.17 0.24 0.31 0.28
large S≈128
Embedded
0.08 0.18 0.25 0.26 0.31
large S≈128
Embedded
extra large 0.08 0.18 0.24 0.24 0.34
S≈320
Table 7 : Effort and schedule fractions occurring in each phase of the lifecycle
62
Software Project Planning
Lifecycle Phase Values of p
Mode & Code Plan & System Detailed Module Code Integration
Size Requirements Design Design & Test & Test
Organic Small
0.10 0.19 0.24 0.39 0.18
S≈2
Organic
0.12 0.19 0.21 0.34 0.26
medium S≈32
Semidetached
0.20 0.26 0.21 0.27 0.26
medium S≈32
Semidetached
0.22 0.27 0.19 0.25 0.29
large S≈128
Embedded
0.36 0.36 0.18 0.18 0.28
large S≈128
Embedded
extra large 0.40 0.38 0.16 0.16 0.30
S≈320
Table 7 : Effort and schedule fractions occurring in each phase of the lifecycle
63
Software Project Planning
64
Software Project Planning
Example: 4.7
A new project with estimated 400 KLOC embedded system has to be
developed. Project manager has a choice of hiring from two pools of
developers: Very highly capable with very little experience in the
programming language being used
Or
65
Software Project Planning
Solution
This is the case of embedded mode and model is intermediate
COCOMO.
Hence E = ai (KLOC) d i
= 2.8 (400)1.20 = 3712 PM
Case I: Developers are very highly capable with very little experience
in the programming being used.
66
Software Project Planning
Case II: Developers are of low quality but lot of experience with the
programming language being used.
Case II requires more effort and time. Hence, low quality developers
with lot of programming language experience could not match with
the performance of very highly capable developers with very litter
experience.
67
Software Project Planning
Example: 4.8
Consider a project to develop a full screen editor. The major components
identified are:
I. Screen edit
II. Command Language Interpreter
III. File Input & Output
IV. Cursor Movement
V. Screen Movement
The size of these are estimated to be 4k, 2k, 1k, 2k and 3k delivered source code
lines. Use COCOMO to determine
1. Overall cost and schedule estimates (assume values for different cost
drivers, Required software reliability is high, Product complexity is
high, Analyst capability is high, Programming language experience
is low, others are nominal)
2. Cost & Schedule estimates for different phases. 68
Software Project Planning
Solution
69
Software Project Planning
70
Software Project Planning
(a) The initial effort estimate for the project is obtained from the
following equation
E = ai (KLOC)bi x EAF
= 3.2(12)1.05 x 1.2169 = 52.91 PM
Development time D = Ci(E)di
= 2.5(52.91)0.38 = 11.29 M
(b) Using the following equations and referring Table 7, phase wise
cost and schedule estimates can be calculated.
E p = p E
Dp = p D
71
Software Project Planning