Sei sulla pagina 1di 4

1

DEPARTMENT OF COMPUTER ENGINEERING Experiment No. 10


Semester T.E. Semester VI Computer Engineering
Subject Object Oriented Software Engineering
Subject Professor In-
charge
Prof. Kavita Shirsat
Laboratory L05C

Student Name Ravi P. Bhat
Roll Number 11-205
Grade and Subject
Teachers Signature





Experiment
Number
10
Experiment
Title
Program for COCOMO based cost estimation
Resources /
Apparatus
Required

Hardware:
Computer System

Software:
JDK 1.4 and Notepad++
Objectives
(Skill Set /
Knowledge
Tested /
Imparted)

To write a Java program to compute COCOMO based cost estimation based on no of lines
of code.
Theory of
Operation

The Constructive Cost Model (COCOMO) is an algorithmic software cost estimation
model developed by Barry W. Boehm. The model uses a basic regression formula with
parameters that are derived from historical project data and current project characteristics.
COCOMO consists of a hierarchy of three increasingly detailed and accurate forms. The
first level, Basic COCOMO is good for quick, early, rough order of magnitude estimates of
software costs, but its accuracy is limited due to its lack of factors to account for difference
in project attributes (Cost Drivers). Intermediate COCOMO takes these Cost Drivers into
account and Detailed COCOMO additionally accounts for the influence of individual project
phases.
Basic COCOMO:
Basic COCOMO computes software development effort (and cost) as a function of
program size. Program size is expressed in estimated thousands of source lines of code
(SLOC)
COCOMO applies to three classes of software projects:
Organic projects - "small" teams with "good" experience working with "less than rigid"
requirements



2



Semi-detached projects - "medium" teams with mixed experience working with a mix of
rigid and less than rigid requirements
Embedded projects - developed within a set of "tight" constraints. It is also combination of
organic and semi-detached projects.(hardware, software, operational, ...)

The basic COCOMO equations take the form
Effort Applied (E) = ab(KLOC)bb [ man-months]
Development Time (D) = cb(Effort Applied)db [months]
People required (P) = Effort Applied / Development Time [count]
Where,
KLOC is the estimated number of delivered lines (expressed in thousands) of code for
project.
The coefficients ab, bb, cb and db are given in the following table:
Software project ab bb cb db
Organic 2.4 1.05 2.5 0.38
Semi-detached 3.0 1.12 2.5 0.35
Embedded 3.6 1.20 2.5 0.32

Basic COCOMO is good for quick estimate of software costs. However it does not account
for differences in hardware constraints, personnel quality and experience, use of modern
tools and techniques, and so on.

Code:
import java.util.Scanner;
public class Cocomo
{
public static void main(String[] args)
{
String coco[][] = new String[4][5];
coco[0][0]="Software Project";
coco[0][1]="ab";
coco[0][2]="bb";
coco[0][3]="cb";
coco[0][4]="db";

coco[1][0]="Organic";
coco[1][1]="2.4";
coco[1][2]="1.05";
coco[1][3]="2.5";
coco[1][4]="0.38";



3



coco[2][0]="Semi-detached";
coco[2][1]="3.0";
coco[2][2]="1.12";
coco[2][3]="2.5";
coco[2][4]="0.35";

coco[3][0]="Embedded";
coco[3][1]="3.6";
coco[3][2]="1.2";
coco[3][3]="2.5";
coco[3][4]="0.32";

Scanner sc = new Scanner(System. in);
System.out.print("Enter number of lines: ");
int l = sc.nextInt();
int type;
do
{
System.out.println("Enter software project type:\n 1: Organic\n 2: Semi-detached\n 3:
Embedded\n");
type = sc.nextInt();
if(type<1 || type>3)
System.out.println("Enter proper input ");
}while(type<1 || type>3);

double efforts = Double.parseDouble(coco[type][1])*(Math.pow(l,
Double.parseDouble(coco[type][2])));
double devetime=Double.parseDouble(coco[type][3])*(Math.pow(efforts,
Double.parseDouble(coco[type][4])));
double pm=Math. round(efforts/devetime);
System.out.println("\nEfforts:\t\t"+String.format("%.4f", efforts));
System.out.println("Time for Development:\t"+String.format("%.0f", devetime));
System.out.println("Person-Months :\t\t"+String.format("%.0f", pm));
}
}
























4



Output





Conclusion

Advantages of COCOMO estimating model are:
1. COCOMO is factual and easy to interpret. One can clearly understand how it works.
2. Accounts for various factors that affect cost of the project.
3. Works on historical data and hence is more predictable and accurate.
Hence we have successfully implemented Basic COCOMO which describes in brief how to
make cost estimate for a project.

Potrebbero piacerti anche