You are on page 1of 10

Department of Computer Engineering

Experiment No.5

Date :
Roll No :

Aim :
Theory :
Cost Estimation
Cost estimation simply means a technique that is used to find out the cost estimates. The
cost estimate is the financial spend that is done on the efforts to develop and test software
in Software Engineering. Cost estimation models are some mathematical algorithms or
parametric equations that are used to estimate the cost of a product or a project.

Project Size
Project size estimation is a crucial aspect of software engineering, as it helps in planning
and allocating resources for the project.

Project Cost
Project cost estimation is the process of predicting the quantity, cost, and price of the
resources required by the scope of a project. Since cost estimation is about the prediction
of costs rather than counting the actual cost, a certain degree of uncertainty is involved.

Project Duration
Project duration refers to the length of time a specific project will take to complete based
on the work effort and work quantity. Project duration estimation is highly important for
project managers who need to calculate when their teams can finish the tasks, what
resources they need, and how much time they have left before reaching the scheduled
completion date.

Project Effort
Amount of labour that will be required to complete a task. It is measured in person-months
units.
To estimate the effort required to develop an Online Food Ordering System.

Step 1: Define Project Parameters


Size of the software (in KLOC - Kilo Lines of Code):
Considering the
Online Food Ordering System of major 7 modules which are
1. Menu Listing – 2.5 KLOC
2. Restaurant Management - 2 KLOC
3. Cart & Orders – 1.5 KLOC
4. Food Recommendation - 2 KLOC
5. Payment Processing - 1 KLOC
6. Delivery Management - 3 KLOC
7. Ratings & Reviews - 1 KLOC
Total Size - 13 KLOC

Step 2: Calculate Effort


The effort is calculated using the formula:
Effort a*(Size)^b
Where 'a' and 'b' are constants specific to the project type. For organic projects (which are
relatively small, well-understood, and developed in a familiar environment), the typical
values a=2.4 and b=1.05.
Given the size (Size = 13 KLOC), we can calculate the effort :
Effort = 2.4*(13)^1.05~35.4692 Person-Months

Step 3: Calculate Schedule


The schedule is calculated using the formula: Schedule (in months) = c*(Effort)^d
Where 'c' and 'd' are contents specific to the project type. For organic projects, the typical
values c=3.0 and d=0.38.
Using the calculated effort (Effort~35.4692 Person-Months), we can calculate the schedule:
Schedule (in months) = 3.0*(35.4692)^0.38~11.64 months.

Steps 4: Calculate People Required


The number of people required is calculated using the formula:
People=Effort/Schedule Using the calculated effort(Effort~35.4692 Person~Months) and
schedule (Schedule~11.64 months), we can calculate the number of people required:
People=35.4692/11.64~3.0471 people
COCOMO Model

Cocomo (Constructive Cost Model) is a regression model based on LOC, i.e number of
Lines of Code. It is a procedural cost estimate model for software projects and is often
used as a process of reliably predicting the various parameters associated with making a
project such as size, effort, cost, time, and quality. It was proposed by Barry Boehm in
1981 and is based on the study of 63 projects, which makes it one of the best-documented
models.
The key parameters which define the quality of any software products, which are also an
outcome of the Cocomo are primarily Effort & Schedule:
 Effort: Amount of labor that will be required to complete a task. It is measured in
person-months units.
 Schedule: Simply means the amount of time required for the completion of the job,
which is, of course, proportional to the effort put in. It is measured in the units of
time such as weeks, and months.

Different models of Cocomo have been proposed to predict the cost estimation at different
levels, based on the amount of accuracy and correctness required. All of these models can
be applied to a variety of projects, whose characteristics determine the value of the
constant to be used in subsequent calculations.
These characteristics pertaining to different system types are mentioned below. Boehm’s
definition of organic, semidetached, and embedded systems:
1. Organic – A software project is said to be an organic type if the team size required
is adequately small, the problem is well understood and has been solved in the past
and also the team members have a nominal experience regarding the problem.
2. Semi-detached – A software project is said to be a Semi-detached type if the vital
characteristics such as team size, experience, and knowledge of the various
programming environment lie in between that of organic and Embedded. The
projects classified as Semi-Detached are comparatively less familiar and difficult
to develop compared to the organic ones and require more experience and better
guidance and creativity. Eg: Compilers or different Embedded Systems can be
considered Semi-Detached types.
3. Embedded – A software project requiring the highest level of complexity,
creativity, and experience requirement fall under this category. Such software
requires a larger team size than the other two models and also the developers need
to be sufficiently experienced and creative to develop such complex models.

According to Boehm, software cost estimation should be done through three stages:
1. Basic Model
2. Intermediate Model
3. Detailed Model
1. Basic COCOMO Model
It is the one type of static model to estimates software development effort quickly and
roughly. It mainly deals with the number of lines of code and the level of estimation
accuracy is less as we don't consider the all parameters belongs to the project. The
estimated effort and scheduled time for the project are given by the relation:
Effort (E) = a*(KLOC)b MM
Scheduled Time (D) = c*(E)d Months(M)
Where,
E = Total effort required for the project in Man-Months (MM).
D = Total time required for project development in Months (M).
KLOC = the size of the code for the project in Kilo lines of code.
a, b, c, d = The constant parameters for a software project.
The value of constants a,b,c and d are given below :

Online Food Ordering System was estimated with a size of 13 KLOC.


For Organic
Effort (E) = a*(KLOC)b = 2.4*(13)1.05 = 32.76 MM
Scheduled Time (D) = c*(E)d = 2.5*(32.76)0.38 = 31.12 Months(M)
Avg. Resource Size = E/D = 32.76/31.12 = 1.052 Mans Productivity of Software =
KLOC/E=13/32.76 = 0.3968 KLOC/MM = 396.8 LOC/MM
For Semi-Detached
Effort (E) = a*(KLOC)b = 3.0*(13)1.12 = 43.68 MM Scheduled Time (D) = c*(E)d =
2.5*(43.68)0.35 = 38.22 Months(M)
For Embedded
Effort (E) = a*(KLOC)b = 3.6*(13)1.2 = 56.16 MM Scheduled Time (D) = c*(E)d =
2.5*(56.16)0.32 = 44.92 Months(M)

2. Intermediate Model
The intermediate model estimates software development effort in terms of size of the
program and other related cost drivers parameters (product parameter, hardware
parameter, resource parameter, and project parameter) of the project. The estimated
effort and scheduled time are given by the relationship:
Effort (E) = a*(KLOC)b *EAF MM
Scheduled Time (D) = c*(E)d Months(M)
Where,
E = Total effort required for the project in Man-Months (MM).
D = Total time required for project development in Months (M).
KLOC = The size of the code for the project in Kilo lines of code.
a, b, c, d = The constant parameters for the software project.
EAF = It is an Effort Adjustment Factor, which is calculated by multiplying the
parameter values of different cost driver parameters. For ideal, the value is 1.

The estimated size of the project is 13 KLOC.


Developer having highly application experience: 0.82 (as per above table) Developer
having very low experience in programming: 1.14(as per above table)
EAF 0.82* 1.14 = 0.9348
Effort (E) = a*(KLOC)b *EAF = 3.0*(13)1.12 *0.9348 40.83 MM =
Scheduled Time (D) - c*(E)d = 2.5*(40.83)0.35 = 35.72 Months(M)
3. Detailed Model
The Detailed COCOMO (Constructive Cost Model) is a comprehensive software cost
estimation model that considers various project attributes and development practices in
great detail. It is typically used for large and complex software projects. Detailed
COCOMO estimates effort, cost, and schedule by breaking down the project into
multiple phases and considering various factors at each stage. Here are the formulas and
an example calculation for the Detailed COCOMO model:
Formula,
The Detailed COCOMO model breaks down the estimation into multiple phases, and
the general formula for effort (E) in Detailed COCOMO is as follows:
E = EAF * (Effort Applied to Each Phase)
Where,
EAF (Effort Adjustment Factor) is calculated based on various cost drivers. "Effort
Applied to Each Phase" represents the effort required for each development phase.

The model divides the software development process into several phases, each with its
own effort estimation formula.
 Planning and Requirements (E_Plan): Effort is estimated based on historical
data and expert judgment.
 System Design (E_Design): Effort is estimated based on the size and complexity
of the design.
 Detailed Design (E_Detail): Effort is estimated based on the number of
components/modules and their complexity.
 Coding and Unit Testing (E_CodeUnitTest): Effort is estimated based on lines
of code (LOC) or function points and complexity.
 Integration and Testing (E_Integration Test): Effort is estimated based on the
number of modules/components and their complexity.
 Maintenance (E_Maintenance): Effort is estimated based on the expected
 duration and complexity of maintenance activities.

Let's calculate the effort for Online Food Ordering System using Detailed COCOMO.
Size of the software product: 13 KLOC.

Historical data for the distribution of effort across phases:


Planning and Requirements (E_Plan): 10 person-months
System Design (E_Design): 20 person-months
Detailed Design (E_Detail): 30 person-months
Coding and Unit Testing (E_CodeUnitTest): 120 person-months Integration and Testing
(E_Integration Test): 60 person-months
Maintenance (E_Maintenance): 30 person-months
To calculate the EAF, you need to assess various cost drivers.
Let's assume the EAF is determined to be 1.2.
Now, you can calculate the total effort (E):
Calculate the effort for each phase:
E_Plan = 10 person-months
E_Design = 20 person-months
E_Detail = 30 person-months
E_CodeUnitTest 120 person-months E_Integration Test = 60 person-months
E_Maintenance = 30 person-months

Sum up the efforts for each phase:


Total Effort (E) = E_Plan + E_Design + E_Detail + E_CodeUnitTest +
E_IntegrationTest + E_Maintenance
Total Effort (E) = 10+20+30 + 120+ 60+30=270 person-months.

Apply the Effort Adjustment Factor (EAF):


E = EAF* Total Effort (E)
E = 1.2 * 270
E = 324 person-months.

So, the estimated effort required for this software project is approximately 324 person-
months using the Detailed COCOMO model. This estimation takes into account the
effort distribution across different phases and the impact of various cost drivers on the
project's complexity.

The 6 Phases of Detailed COCOMO are:


1. Planning and requirements: In this phase, project planning and initial requirements
analysis take place, estimating initial effort based on expert judgment.
2. System structure: During this phase, the overall system structure is designed, and a
more detailed effort estimate is made based on the architectural plan.
3. Complete Structure: Detailed design of individual modules and components is
performed, refining the effort estimate.
4. Module code and test: Actual coding and unit testing of modules occur, with effort
estimates based on lines of code and module complexity.
5. Integration and test: Modules are integrated, and system-level testing is carried out,
refining the effort estimate further.
6. Cost Constructive Model: This phase involves the final refinement of the effort
estimate based on comprehensive project attributes, cost drivers, and historical data.
Advantages of the COCOMO model:
1. Provides a systematic way to estimate the cost and effort of a software project.
2. Can be used to estimate the cost and effort of a software project at different stages
of the development process.
3. Helps in identifying the factors that have the greatest impact on the cost and effort
of a software project.
4. Can be used to evaluate the feasibility of a software project by estimating the cost
and effort required to complete it.

Disadvantages of the COCOMO model:


1. Assumes that the size of the software is the main factor that determines the cost
and effort of a software project, which may not always be the case.
2. Does not take into account the specific characteristics of the development team,
which can have a significant impact on the cost and effort of a software project.
3. Does not provide a precise estimate of the cost and effort of a software project, as
it is based on assumptions and averages.

HALSTEAD Complexity Matrix

Halstead's Software metrics are a set of measures proposed by Maurice Halstead to evaluate
the complexity of a software program. These metrics are based on the number of distinct
operators and operands in the program and are used to estimate the effort required to
develop and maintain the program.

Halstead's software metrics can be used to estimate the size, complexity, and effort required
to develop and maintain a software program. However, they have some limitations, such as
the assumption that all operators and operands are equally important, and the assumption
that the same set of metrics can be used for different programming languages and
development environments.

Overall, Halstead's software metrics can be a useful tool for software developers and project
managers to estimate the effort required to develop and maintain software programs.

4 Parameters of HALSTEAD Complexity Matrix:


 n1 = Number of distinct operators.
nl represents the total number of operator occurrences in the program. It includes all
instances of operators, even if they are repetitions of the same operator.
 n2 = Number of distinct operands.
n2 represents the total number of operand occurrences in the program. Similar to nl,
it includes all instances of operands, even if they are repetitions of the same operand.
 N1 = Total number of occurrences of operators.
N1 represents the total number of distinct operators in the program. Operators
include all symbols or keywords that perform operations, such as arithmetic
operators (+, -, *, /), logical operators (AND, OR, NOT), assignment operators (=),
and other language-specific operators.
 N2 = Total number of occurrences of operands.
N2 represents the total number of distinct operands in the program. Operands are
variables, constants, or other entities on which operations are performed.

Halstead Program Length: The total number of operator occurrences and the total number
of operand occurrences.
N = N1 + N2
And estimated program length is, N^=n1log2n1 +n2log2n2
The following alternate expressions have been published to estimate program length:
 NJ = log2(n1!) + log2(n2!)
 NB = n1 * log2 n2 + n2* log2n1
 NC = n1 * sqrt(n1) + n2* sqrt(n2)
 NS = (n* log2n)/2

Halstead Vocabulary: The total number of unique operators and unique operand
occurrences.
n = n1 + n2

Program Volume: Proportional to program size, represents the size, in bits, of space
necessary for storing the program. This parameter is dependent on specific algorithm
implementation. The properties V, N, and the number of lines in the code are shown to be
linearly connected and equally valid for measuring relative program size.
V = Size * (log2 vocabulary) = N * log2(n)
The unit of measurement of volume is the common unit for size "bits". It is the actual size
of a program if a uniform binary encoding for the vocabulary is used.
And error = Volume / 3000

Program Difficulty: This parameter shows how difficult to handle the program is.
D= (n1 / 2) * (N2/n2)
D= 1/L
As the volume of the implementation of a program increases, the program level decreases
and the difficulty increases. Thus, programming practices such as redundant usage of
operands, or the failure to use higher-level control constructs will tend to increase the
volume as well as the difficulty.

Programming Effort: Measures the amount of mental activity needed to translate the
existing algorithm into implementation in the specified program language.
E=V/L=D*V = Difficulty * Volume.
Programming Time: Shows time (in minutes) needed to translate the existing algorithm
into implementation in the specified program language.
T=E/ (f* S)
The concept of the processing rate of the human brain, developed by psychologist John
Stroud, is also used. Stoud defined a moment as the time required by the human brain
requires to carry out the most elementary decision. The Stoud number
S is therefore Stoud's moments per second with:
5 <=S<= 20. Halstead uses 18. The value of S has been empirically developed from
psychological reasoning, and its recommended value for programming applications is 18.
Stroud number S = 18 moments / second seconds-to-minutes factor f = 60

Conclusion :
We learned to estimate the effort and schedule time which is 35.46 Person-Months and
11.64 Months simultaneously.

You might also like