Project Estimation
Software Engineering 2
Fundamental Estimation Questions
• How much effort is required to complete an activity?
• How much calendar time is needed to complete an activity?
• What is the total cost of an activity?
• Project estimation and scheduling are interleaved management activities.
• Project Estimation is done on the basis of :
• • Project size
• • Project Cost
• • Effort required
• • Project duration
Software Engineering 3
Software Cost Components
• Hardware and software costs.
• Travel and training costs.
• Effort costs (the dominant factor in most
projects)
• The salaries of engineers involved in the project;
• Social and insurance costs.
• Effort costs must take overheads into account
• Costs of building, heating, lighting.
• Costs of networking and communications.
• Costs of shared facilities (e.g library, staff restaurant, etc.).
Software Engineering 4
Costing and Pricing
• Estimates are made to discover the cost, to the developer, of
producing a software system.
• There is not a simple relationship between the development cost and
the price charged to the customer.
Software Engineering 5
Software Productivity
•A measure of the rate at which individual
engineers involved in software development
produce software and associated
documentation.
• Not quality-oriented although quality assurance is a factor in
productivity assessment.
• Essentially, we want to measure useful
functionality produced per time unit.
Software Engineering 6
Productivity Measures
• Size related measures based on some output from the software
process. This may be lines of delivered source code, object code
instructions, etc.
• Function-related measures based on an estimate of the functionality
of the delivered software. Function-points are the best known of this
type of measure.
• Metrics used for project size estimation
• Lines of codes (LOC)
• Functional points (FPs)
Software Engineering 7
Productivity Comparisons
• The more verbose the programmer, the higher
the productivity
• Measures of productivity based on lines of code suggest that programmers who write
verbose code are more productive than programmers who write compact code.
• The lower level the language, the more
productive the programmer
• The same functionality takes more code to implement in a lower-level language than in a
high-level language.
Software Engineering 8
Software Engineering 9
Lines of Code Estimation
Software Engineering 10
LOC
• Count every line of source code except blanks (improve code
readability) or comments
• (improves code understandability).
• Count each declaration, actual code containing logic and
computations
• Advantages:
✓ Easy to count and calculate
• Disadvantages:
✓ Not a good metric for estimation as its highly dependent on the
programming language used.
Software Engineering 11
LOC
Software Engineering 12
LOC based estimation example 1
• The mechanical CAD software will accept two- and three-dimensional
geometric data from an engineer.
• The engineer will interact and control the CAD system through a user
interface that will exhibit characteristics of good human/machine interface
design.
• All geometric data and other supporting information will be maintained in a
CAD database.
• Design analysis modules will be developed to produce the required output,
which will be displayed on a variety of graphics devices.
• The software will be designed to control and interact with peripheral
devices that include a mouse, digitizer, laser printer, and plotter.
Software Engineering 13
LOC based estimation example 1
Software Engineering 14
LOC based estimation example 1
Software Engineering 15
LOC based estimation example 2
• Login and registration module: 1000 LOC
• Search and booking module: 3000 LOC
• Payment and checkout module: 2000 LOC
• User profile module: 1500 LOC
• Feedback and rating module: 500 LOC
• Use historical data to estimate the effort required to develop the
project:
• Let's assume that the historical data suggests an average of 600 LOC
per person-month and an average cost of $8000 per person-month.
Software Engineering 16
LOC based estimation example 2
• Calculate the total number of lines of code:
• Total LOC = 1000 + 3000 + 2000 + 1500 + 500 = 8000
• Cost per LOC = $8000 / 600 = 13.3
• Effort required = Total LOC / LOC per person-month = 8000 / 600 =
13.3 person-months.
• Project cost = Estimated LOC* Cost per LOC = 8000 * $13.3 =
$106,400
Software Engineering 17
LOC based estimation example 3
• Suppose we have a software project that is estimated to be 50,000
lines of code. The development team consists of 5 developers, each
with a salary of $50 per hour. The project is expected to take 12
months to complete. Assuming 160 hours per month per developer
and a productivity rate of 600 lines of code per developer per month.
✔ 1. Calculate the total effort required for the project
✔ 2. Calculate the total cost of each developer per month
✔ 3. Calculate the total cost of the project
Software Engineering 18
Function Point Estimation
Software Engineering 19
Function Points
• Based on a combination of program characteristics
• external inputs and outputs;
• user interactions;
• external interfaces;
• files used by the system.
• A weight is associated with each of these and the function point
count is computed by multiplying each raw count by the weight
and summing all values.
Software Engineering 20
FP Information Domain
• Number of external inputs (EIs). Each external input originates from a user and provides
distinct application-oriented data or control information. Inputs are often used to update
internal logical files (ILFs). Inputs should be distinguished from inquiries, which are
counted separately.
• Number of external outputs (EOs). Each external output is derived data within the
application that provides information to the user.
• Number of external inquiries (EQs). An external inquiry is defined as an online input that
results in the generation of some immediate software response in the form of an online
output (often retrieved from an ILF).
• Number of internal logical files (ILFs). Each internal logical file is a logical grouping of data
that resides within the application’s boundary.
• Number of external interface files (EIFs). Each external interface file is a logical grouping of
data that resides external to the application but provides information that may be of use
to the application.
Software Engineering 21
Software Engineering 22
1. Computing FPs
Software Engineering 23
2. Calculating CAF
Complexity Adjustment Factor
Software Engineering 24
2. Calculating CAF
Complexity Adjustment Factor
Software Engineering 25
Example: DFD for computing FP
Software Engineering 26
Computing FP
Software Engineering 27
Software Engineering 28
Reconciling LOC and FP Metrics
/Productivity Estimates
• FPs can be used to estimate LOC depending on the average number of
LOC per FP for a given language
• LOC = AVC * number of function points;
• AVC is a language-dependent factor varying from 200-300 for assemble language to 2-40 for a
4GL;
• The relationship between lines of code and function points depends upon the programming
language that is used to implement the software and the quality of the design.
• A number of studies have attempted to relate FP and LOC measures. The following table 4
[QSM02] provides rough estimates of the average number of lines of code required to build
one function point in various programming languages:
Software Engineering 29
Software Engineering 30
FP based estimation Example 2
• User input = 55
• User outputs = 35
• User enquiries = 40
• User files = 8
• External interfaces =5
• Calculate FP = UFP * CF
• Calculate CAF
• CAF = 0.65 +(0.01 * Σ Fi )
• Lets say, the product is significantly complex product so all 14 questions answered in
moderately form i.e. 4
• Σ Fi = ? (if complexity factor is differing for each FP then calculate separately.)
• CAF = 0.65 + ( 0.01 * ? ) = ?
• FP = UFP * CAF
• FP = ? * ? = ?
Software Engineering 31
FP based estimation Example 2
Software Engineering 32
FP based estimation Example 3
• Suppose we have a software project that has an estimated size of
5000 function points. We have historical data that shows that it takes
an average of 10 person hours to complete one function point. The
team consists of 8 developers, each with a salary of $60 per hour. The
project is expected to take 12 months to complete. Calculate the
effort required and total cost of the project.
Software Engineering 33
FP based estimation Example 3
• To calculate the effort required for this project, we can use the following formula:
• Given that the estimated size of the project is 5000 function points and the
productivity factor is 10FP/pm, the effort required would be:
• Effort = 5000/10 = 500 person-months
• To calculate the total cost of the project, we can use the following formula
• Total Cost = Effort x Monthly Cost per Person
• Given that the team consists of 8 developers, each with a salary of $60 per hour,
the monthly cost per person would be:
• Monthly Cost per Person = 8 x 20 x $60 = $9,600
• Therefore, the total cost of the project would be:
• Total Cost = 500 x $9,600 = $4,800,000
Software Engineering 34
FP based estimation Example 4
Software Engineering 35
FP based estimation Example 4
• Calculate the Unadjusted Function Points (UFP)
• UFP = (10 x 4) + (6 x 5) + (4 x 4) = 66
• Calculate CAF.
• CAF= 0.65 + (0.01*Fi) (Assume complexity adjustment factor is
average)
• Now, calculate Functional Points
Software Engineering 36
FP based estimation Example 5
• Suppose we have a software project with an estimated size of 50,000
lines of code (LOC) and 5000 function points (FP). We have historical
data that shows that it takes an average of 10 person-hours to
complete 1000 lines of code, and an average of 10 person-hours to
complete one function point. The team consists of 8 developers, each
with a salary of $60 per hour. The project is expected to take 12
months to complete. Calculate the effort required and total cost of
the project using both LOC and functional points.
Software Engineering 37
Using Lines of Code (LOC):
• Total person-hours required based on LOC:
• Total LOC = 50,000
• Average person-hours per 1000 lines of code = 10 hours Total person-hours
• = (Total LOC / 1000) * Average person-hours per 1000 LOC
• = (50,000 / 1000) * 10 hours = 500 * 10 hours = 5000 hours
• Total cost of the project based on LOC:
• Total person-hours = 5000 hours
• Number of developers = 8
• Salary per developer per hour = $60
• Total cost = Total person-hours * Number of developers * Salary per developer
per hour
• = 5000 hours * 8 developers * $60/hour
• = $2,400,000
Software Engineering 38
Using Function Points (FP):
• Total person-hours required based on FP:
• Total FP = 5000
• Average person-hours per FP = 10 hours
• Total person-hours = Total FP * Average person-hours per FP
• = 5000 FP * 10 hours/FP = 50,000 hours
• Total cost of the project based on FP:
• Total person-hours = 50,000 hours
• Number of developers = 8
• Salary per developer per hour = $60
• Total cost = Total person-hours * Number of developers * Salary
per developer per hour
• = 50,000 hours * 8 developers * $60/hour
• = $24,000,000
Software Engineering 39