COCOMO Model in Software Engineering: Overview & Types

Updated on July 3, 2024

Article Outline

The COCOMO Model, which is also known as the Constructive Cost Model, is one of the highly recognised and utilised models for software cost estimation in software engineering. This method was developed by Barry Bohem in the early 1980s to solve the problem of irregular cost estimation and to provide a structured approach, which is both time-saving and efficient in giving the cost required for software development projects. Today, software is becoming more complex and can take a great number of resources. Hence, the COCOMO Model provides various types of basic, intermediate, and detailed models that can handle such complex projects.

 

In this post, we will be discussing the whole architecture of the COCOMO Model in software engineering, its fundamentals, different types of COCOMO model, key parameters, phases, pros, and cons and highlighting its significance in effective software project management. We will also be discussing real-world applications and best practices for using the COCOMO model.

 

What is the COCOMO Model?

The Constructive Cost Model or COCOMO Model estimates the cost for any software development project based on the empirical data obtained from observations and uses a mathematical formula to estimate these parameters. This makes it a highly reliable tool for project managers and software engineers.

 

Importance of the COCOMO Model:

The following are the primary tasks of any COCOMO Model.

 

  • Improve Project Planning: The model provides a clear estimate of the required resources and planning project timeline, which helps meet the deadline.
  • Facilitate Risk Management: When the model predicts cost estimates and any delay regarding project development, it helps to manage early risks and future planning.
  • Enhance Resource Management: The model also provides how to allocate the right amount of resources at the right time, optimising the given data and efficient workflow.
  • Benchmarking: The COCOMO Model helps to compare and assess various software development projects to industry standards, offering a benchmark.

 

Also Read: Waterfall Model in Software Engineering

*Image
Get curriculum highlights, career paths, industry insights and accelerate your technology journey.
Download brochure

Architecture of the COCOMO Model

The architecture of the COCOMO Model provides a highly systemic approach to project value estimation with the help of a structured and organised framework.

 

Workflow of the COCOMO Model

cocomo work flow

Core components of the COCOMO Model

 

1. Size Estimation

  • Measure: Measured generally in KSLOC.
  • Aim: To quantify the size of a software project, which will be the primary input for the estimation process.
  • Example: Input: 50 KSLOC, etc.

 

2. Effort Estimation

  • Measure: E = a * (Size)^b
  • Aim: a and b are the constants derived from historical project data that work as crucial multipliers which can vary depending upon the type of COCOMO model.
  • Example: Output: 100 person-months

 

3. Cost Drivers

  • Categories: Holds many categories like project attributes, hardware attributes, personal attributes, and product attributes.
  • Aim: To adjust the effort estimation with the help of various factors that could potentially affect the project’s complexity and productivity.
  • Example: Product, Hardware, Project Attributes, etc.

 

4. Effort Adjustment Factor (EAF)

  • Measure: It can be calculated using factoring in the ratings of all the cost drivers.
  • Aim: To fine-tune and refine the effort estimation based on the resources.
  • Example: EAF = 1.1

 

5. Schedule Estimation

  • Measure: TDEV = c * (Effort)^d
  • Aim: Here again, c and d are the constants depending upon the COCOMO model types derived from similar previous projects.
  • Example: Output: 12 months

Descriptions for each key element

 

  • Size of software (KLOC): This is one derived metric made from thousands of source lines of code to measure the size of software.
  • Effort (E): An estimated effort that is required while calculating. This is measured in person-months
  • Effort Adjustment Factor (EAF): This is a multiplier that can adjust the effort estimation with the help of various project-related factors.
  • Development Time (TDEV): A complete estimation of the time required to complete the project.

Types of COCOMO Model

The COCOMO Model is categorised into three levels of estimation:

 

1. Basic COCOMO Model

 

This COCOMO Model is the simplest form that provides a rough estimate of any project based on the size of the software alone. Hence, it is suitable for small to medium-sized projects with straightforward requirements.

2. Intermediate COCOMO Model

 

The intermediate model adds more complexity and details to the Basic Model by adding cost drivers and effort estimation with more inputs. Mostly used for medium to large projects.

3. Detailed COCOMO Model

 

The most comprehensive form among the three types includes the inclusion of all the features of the intermediate model with the addition of a detailed analysis of each cost component in the software project. Works for a highly complex project which has a very large upscaling scope.

Overall comparison with different COCOMO Models.

 

Feature Basic COCOMO Intermediate COCOMO Detailed COCOMO
Purpose Rough estimate based on software size More detailed estimate with additional parameters Detailed analysis, including all cost drivers
Key Parameters Size of software (KSLOC) Size of software (KSLOC) + 15 cost drivers Size of software (KSLOC) + all cost drivers in detail
Accuracy Low to medium Medium to high High
Effort Estimation Formula E = a * (KLOC)^b E = a * (KLOC)^b * EAF E = a * (KLOC)^b * EAF (with detailed cost driver adjustments)
Schedule Estimation TDEV = c * (Effort)^d TDEV = c * (Effort)^d * EAF TDEV = c * (Effort)^d * EAF (with detailed cost driver adjustments)
Examples Simple utility programs, small applications Database applications, web applications Large-scale enterprise systems, embedded systems
Use Cases Early project planning, small project estimations More accurate planning for medium to large projects Detailed project planning and control for large projects
Complexity Low Medium High
Time Required for Estimation Short Medium Long
Example Projects Small utility software, Simple data processing software, Basic educational tools Web applications, Database management systems, E-commerce platforms Large-scale enterprise software, Real-time embedded systems, Large integrated software systems
Deadline Flexible Medium Tight

Types of Projects in the COCOMO Model

The COCOMO Model further classifies different types of software projects based on their characteristics, complexity and development environment. All these factors help to define when and which COCOMO model should be applied to which type of project for the overall requirement analysis and to understand the project scope.

 

There are mainly three types of projects, organic projects, semi-detached projects and embedded projects. We can compare all three with several factors as mentioned below.

Detailed Comparison of Project Types with Examples

 

Feature Organic Projects Semi-Detached Projects Embedded Projects
Definition Simple projects with small teams and well-understood requirements Intermediate complexity projects with mixed teams and moderately understood requirements Complex projects with large teams, rigorous requirements, and real-time constraints
Requirements Well-understood, stable Moderately understood, somewhat stable Detailed, frequently changing
Interfaces Few, simple More complex Very complex
Reliability and Performance Less stringent Moderate High
Documentation Needs Minimal Moderate Extensive
Project Size Small (2 to 50 KLOC) Medium (50 to 300 KLOC) Large (300 and above KLOC)
Team Size Small Medium Large
Team Experience Experienced team Mixed levels of experience Diverse expertise
Project Duration Short to medium Medium to long Long
Development Environment Stable and well-understood Moderately dynamic Highly dynamic
Project Management Complexity Low Medium High
Cost Estimation Formula Simplified formula Intermediate formula Detailed formula
General Effort Estimation Constants a=2.4, b=1.05 a=3.0, b=1.12 a=3.6, b=1.20
Example Use Case Small accounting software developed by an experienced team within an organisation or routine data processing. Medium-sized inventory management system with integration into multiple departments and some custom modules. A real-time control system for an industrial automation application involves multiple subsystems and strict performance requirements. Like air traffic control, military and defence systems, and telecommunications systems.

 

Program to Implement COCOMO Model

 

The COCOMO Model uses different constant values for different types of projects, such as organic, semi-detached, and embedded.

Constants for the COCOMO model

 

Below is a table that is generalised for all the constant values depending on model and project type.

 

Model Project Type a b c d
Basic 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
Intermediate Organic 3.2 1.05 2.5 0.38
  Semi-Detached 3.0 1.12 2.5 0.35
  Embedded 2.8 1.20 2.5 0.32
Detailed Organic 3.2 1.05 2.5 0.38
  Semi-Detached 3.0 1.12 2.5 0.35
  Embedded 2.8 1.20 2.5 0.32

 

Estimation and Calculation

 

Several calculations are done to find the effort and the final time to complete the project. For example, let’s take a basic COCOMO model to estimate an organic-type software project.

 

  • KLOC: Estimate size of software product (Kilo Lines Of Code)

 

  • Effort: E = a * (KLOC)^b PM(person-months)
    • E = 2.4 x (50)^1.05 ≈ 146 person-months

 

  • Development Time: TDEV = c * (effort)^d
    • TDEV = 2.5 x (146)^0.38 ≈ 16 months 19 days

 

  • Person Required: Effort/time
    • People required to complete the project are E/TDEV = 146/16.61 ≈ 9

 

Code Implementation

 

Python

 

def cocomo(model_type, size_kloc):

 

# pre-defined constants

constants = {

‘basic’: {

‘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)

},

‘intermediate’: {

‘organic’: (3.2, 1.05, 2.5, 0.38),

‘semi_detached’: (3.0, 1.12, 2.5, 0.35),

’embedded’: (2.8, 1.20, 2.5, 0.32)

},

‘detailed’: {

‘organic’: (3.2, 1.05, 2.5, 0.38),

‘semi_detached’: (3.0, 1.12, 2.5, 0.35),

’embedded’: (2.8, 1.20, 2.5, 0.32)

}

}

 

# Check the project type according to KLOC size

if(size_kloc >= 2 and size_kloc <= 50):

mode = 0

elif(size_kloc > 50 and size_kloc <= 300):

mode = 1

elif(size_kloc > 300):

mode = 2

 

projects = [“organic”,”semi_detached”,”embedded”]

project_type = projects[mode]

print(f”This is an {project_type.upper()} type project”)

 

a, b, c, d = constants[model_type][project_type]

effort = a * (size_kloc ** b)

tdev = c * (effort ** d)

 

persons = effort/tdev

 

return effort, tdev, persons

 

# Example Input

model_type = ‘intermediate’  # ‘basic’, ‘intermediate’, ‘detailed’

size_kloc = 200

 

effort, time, person = cocomo(model_type, size_kloc)

 

#Outputs

print(f”–> Effort: {effort} Person-Months”)

print(f”–> Development Time: {time} Months”)

print(f”–> Estimated Staff Required: {person} Persons”)

Output

 

C++

 

#include <iostream>

#include <cmath>

 

using namespace std;

 

// Predefined constants as a 2D array

double constants[3][3][4] = {

// Basic

{

{2.4, 1.05, 2.5, 0.38},

{3.0, 1.12, 2.5, 0.35},

{3.6, 1.20, 2.5, 0.32}

},

// Intermediate

{

{3.2, 1.05, 2.5, 0.38},

{3.0, 1.12, 2.5, 0.35},

{2.8, 1.20, 2.5, 0.32}

},

// Detailed

{

{3.2, 1.05, 2.5, 0.38},

{3.0, 1.12, 2.5, 0.35},

{2.8, 1.20, 2.5, 0.32}

}

};

 

double* cocomo(string modelType, double sizeKLOC) {

// Determine project type based on KLOC size

string projectType;

int mode;

if (sizeKLOC >= 2 && sizeKLOC <= 50) {

projectType = “organic”;

mode = 0;

} else if (sizeKLOC > 50 && sizeKLOC <= 300) {

projectType = “semi_detached”;

mode = 1;

} else if (sizeKLOC > 300) {

projectType = “embedded”;

mode = 2;

} else {

throw invalid_argument(“Invalid size KLOC”);

}

 

// Retrieve constants for the specified model type and project type

double* modelConstants = constants[mode][0]; // Point to the right 1D array

double a = modelConstants[0];

double b = modelConstants[1];

double c = modelConstants[2];

double d = modelConstants[3];

 

// Calculate effort, development time, and estimated staff required

double effort = a * pow(sizeKLOC, b);

double tdev = c * pow(effort, d);

double persons = effort / tdev;

 

double* results = new double[3];

results[0] = effort;

results[1] = tdev;

results[2] = persons;

return results;

}

 

int main() {

string modelType = “intermediate”;  // ‘basic’, ‘intermediate’, ‘detailed’

double sizeKLOC = 200;

 

double* results = cocomo(modelType, sizeKLOC);

 

// Outputs

cout << “–> Effort: ” << results[0] << ” Person-Months” << endl;

cout << “–> Development Time: ” << results[1] << ” Months” << endl;

cout << “–> Estimated Staff Required: ” << results[2] << ” Persons” << endl;

 

delete[] results;  // Free allocated memory

return 0;

}

Output

 

Java

 

import java.util.HashMap;

import java.util.Map;

 

public class COCOMO {

 

// Pre-defined constants

private static final Map<String, Map<String, Double[]>> constants = new HashMap<>();

 

static {

// Constants for Basic COCOMO

constants.put(“basic”, Map.of(

“organic”, new Double[] {2.4, 1.05, 2.5, 0.38},

“semi_detached”, new Double[] {3.0, 1.12, 2.5, 0.35},

“embedded”, new Double[] {3.6, 1.20, 2.5, 0.32}

));

 

// Constants for Intermediate COCOMO

constants.put(“intermediate”, Map.of(

“organic”, new Double[] {3.2, 1.05, 2.5, 0.38},

“semi_detached”, new Double[] {3.0, 1.12, 2.5, 0.35},

“embedded”, new Double[] {2.8, 1.20, 2.5, 0.32}

));

 

// Constants for Detailed COCOMO

constants.put(“detailed”, Map.of(

“organic”, new Double[] {3.2, 1.05, 2.5, 0.38},

“semi_detached”, new Double[] {3.0, 1.12, 2.5, 0.35},

“embedded”, new Double[] {2.8, 1.20, 2.5, 0.32}

));

}

 

public static double[] cocomo(String modelType, double sizeKLOC) {

// Determine project type based on KLOC size

String projectType;

if (sizeKLOC >= 2 && sizeKLOC <= 50) {

projectType = “organic”;

} else if (sizeKLOC > 50 && sizeKLOC <= 300) {

projectType = “semi_detached”;

} else if (sizeKLOC > 300) {

projectType = “embedded”;

} else {

throw new IllegalArgumentException(“Invalid size KLOC”);

}

 

// Retrieve constants for the specified model type and project type

Double[] modelConstants = constants.get(modelType).get(projectType);

double a = modelConstants[0];

double b = modelConstants[1];

double c = modelConstants[2];

double d = modelConstants[3];

 

// Calculate effort, development time, and estimated staff required

double effort = a * Math.pow(sizeKLOC, b);

double tdev = c * Math.pow(effort, d);

double persons = effort / tdev;

 

return new double[] {effort, tdev, persons};

}

 

public static void main(String[] args) {

String modelType = “intermediate”;  // ‘basic’, ‘intermediate’, ‘detailed’

double sizeKLOC = 200;

 

double[] results = cocomo(modelType, sizeKLOC);

 

// Outputs

System.out.println(“–> Effort: ” + results[0] + ” Person-Months”);

System.out.println(“–> Development Time: ” + results[1] + ” Months”);

System.out.println(“–> Estimated Staff Required: ” + results[2] + ” Persons”);

}

}

Output

 

C#

 

using System;

 

public class COCOMO

{

// Predefined constants as a 2D array

private static readonly double[,][] constants =

{

// Basic

{

new double[] {2.4, 1.05, 2.5, 0.38},

new double[] {3.0, 1.12, 2.5, 0.35},

new double[] {3.6, 1.20, 2.5, 0.32}

},

// Intermediate

{

new double[] {3.2, 1.05, 2.5, 0.38},

new double[] {3.0, 1.12, 2.5, 0.35},

new double[] {2.8, 1.20, 2.5, 0.32}

},

// Detailed

{

new double[] {3.2, 1.05, 2.5, 0.38},

new double[] {3.0, 1.12, 2.5, 0.35},

new double[] {2.8, 1.20, 2.5, 0.32}

}

};

 

public static double[] Cocomo(string modelType, double sizeKLOC)

{

// Determine project type based on KLOC size

string projectType;

int mode;

if (sizeKLOC >= 2 && sizeKLOC <= 50)

{

projectType = “organic”;

mode = 0;

}

else if (sizeKLOC > 50 && sizeKLOC <= 300)

{

projectType = “semi_detached”;

mode = 1;

}

else if (sizeKLOC > 300)

{

projectType = “embedded”;

mode = 2;

}

else

{

throw new ArgumentException(“Invalid size KLOC”);

}

 

// Retrieve constants for the specified model type and project type

double[] modelConstants = constants[mode, 0]; // Point to the right 1D array

double a = modelConstants[0];

double b = modelConstants[1];

double c = modelConstants[2];

double d = modelConstants[3];

 

// Calculate effort, development time, and estimated staff required

double effort = a * Math.Pow(sizeKLOC, b);

double tdev = c * Math.Pow(effort, d);

double persons = effort / tdev;

 

return new double[] { effort, tdev, persons };

}

 

public static void Main(string[] args)

{

string modelType = “detailed”;  // ‘basic’, ‘intermediate’, ‘detailed’

double sizeKLOC = 250;

 

double[] results = Cocomo(modelType, sizeKLOC);

 

// Outputs

Console.WriteLine(“–> Effort: ” + results[0] + ” Person-Months”);

Console.WriteLine(“–> Development Time: ” + results[1] + ” Months”);

Console.WriteLine(“–> Estimated Staff Required: ” + results[2] + ” Persons”);

}

}

Output

 

JavaScript

 

const constants = [

[

[2.4, 1.05, 2.5, 0.38],

[3.0, 1.12, 2.5, 0.35],

[3.6, 1.20, 2.5, 0.32]

],

[

[3.2, 1.05, 2.5, 0.38],

[3.0, 1.12, 2.5, 0.35],

[2.8, 1.20, 2.5, 0.32]

],

[

[3.2, 1.05, 2.5, 0.38],

[3.0, 1.12, 2.5, 0.35],

[2.8, 1.20, 2.5, 0.32]

]

];

 

function cocomo(modelType, sizeKLOC) {

let mode;

if (sizeKLOC >= 2 && sizeKLOC <= 50) {

mode = 0;

} else if (sizeKLOC > 50 && sizeKLOC <= 300) {

mode = 1;

} else if (sizeKLOC > 300) {

mode = 2;

} else {

throw new Error(“Invalid size KLOC”);

}

 

const modelConstants = constants[mode][0];

const a = modelConstants[0];

const b = modelConstants[1];

const c = modelConstants[2];

const d = modelConstants[3];

 

const effort = a * Math.pow(sizeKLOC, b);

const tdev = c * Math.pow(effort, d);

const persons = effort / tdev;

 

return [effort, tdev, persons];

}

 

const modelType = “basic”; // basic, intermediate or detailed

const sizeKLOC = 20;

const results = cocomo(modelType, sizeKLOC);

 

console.log(“–> Effort: ” + results[0] + ” Person-Months”);

console.log(“–> Development Time: ” + results[1] + ” Months”);

console.log(“–> Estimated Staff Required: ” + results[2] + ” Persons”);

Output

 

Real-life Applications and Case Studies-Based Examples

 

  1. NASA Projects: NASA has used the COCOMO model for the estimation of various costs and schedules for several space exploration software projects.
  2. Defence Systems: Primarily used by the U.S. Department of Defense to ensure accurate budgeting and timely delivery of software project requirements.
  3. Telecommunications: Telecom companies employ COCOMO to estimate efforts and costs for developing complex network management software.
  4. IBM: IBM applied COCOMO to develop large-scale enterprise software systems, optimise resources, and manage project timelines effectively.
  5. Healthcare: Healthcare IT projects use COCOMO to plan and manage the development of electronic health record systems and other critical applications.

 

Advantages of Using the COCOMO Model

  • Accurate cost estimation
  • Predictable project timelines
  • Helps in resource allocation
  • Supports project planning
  • Provides quantitative analysis
  • Facilitates risk management
  • Improves budgeting accuracy

Limitations of the COCOMO Model

  • Assumes historical data availability
  • Less accurate for small projects
  • Less effective for non-software projects
  • Requires detailed project parameters
  • Limited flexibility for modern methodologies
  • Can be influenced by subjective inputs
  • Complex to apply manually

 

Also Read: How to Become a Software Engineer

Best Practices for Using the COCOMO Model

Any software developer using the COCOMO model can take the steps mentioned below into action to ensure a correct workflow, and the developer can achieve the most efficient and precise cost estimation.

 

  1. Using accurate historical data.
  2. Tailoring model to exact project specifications.
  3. To Update the estimates regularly.
  4. To integrate project management tools.
  5. Combining the current model with other estimation techniques for better judgement.
  6. By validating results with real-world metrics.
  7. Train the team on model usage.
  8. Record all assumptions and changes.
  9. Conduct regular review sessions.
  10. Ensure continuous stakeholder involvement.

Conclusion

In conclusion, the COCOMO model can act as a simple but powerful tool in estimating costs and resources for your software project. The codes provided above may help you to get a good estimation based on the constants already derived through empirical data. Note that these constants are not fixed for every case and can vary based on several factors like requirements, development environment, edge cases, and unique projects that do not resemble any historical data or experience.

 

 

 

FAQs
Effort multipliers are factors that influence the effort required for a project. They include product, computer, personnel, and project attributes.
While COCOMO was designed for traditional development, it can be adapted for Agile projects by updating estimates iteratively and considering Agile-specific factors.
The accuracy of COCOMO depends on the quality of input data and the relevance of historical data. Regular updates and adjustments improve its accuracy.
The project type is determined based on size and complexity. Organic projects are small, Semi-Detached are medium-sized, and Embedded are large and complex.
Yes, the COCOMO model can be tailored to specific projects by adjusting parameters and effort multipliers to better reflect the project's unique characteristics.
Data needed includes project size (KLOC), historical project data, and information on various project attributes such as complexity, team experience, and development environment.

Updated on July 3, 2024

Link

Upskill with expert articles

View all
Free courses curated for you
Basics of Python
Basics of Python
icon
5 Hrs. duration
icon
Beginner level
icon
9 Modules
icon
Certification included
avatar
1800+ Learners
View
Essentials of Excel
Essentials of Excel
icon
4 Hrs. duration
icon
Beginner level
icon
12 Modules
icon
Certification included
avatar
2200+ Learners
View
Basics of SQL
Basics of SQL
icon
12 Hrs. duration
icon
Beginner level
icon
12 Modules
icon
Certification included
avatar
2600+ Learners
View
next_arrow
Hero Vired logo
Hero Vired is a leading LearnTech company dedicated to offering cutting-edge programs in collaboration with top-tier global institutions. As part of the esteemed Hero Group, we are committed to revolutionizing the skill development landscape in India. Our programs, delivered by industry experts, are designed to empower professionals and students with the skills they need to thrive in today’s competitive job market.
Blogs
Reviews
Events
In the News
About Us
Contact us
Learning Hub
18003093939     ·     hello@herovired.com     ·    Whatsapp
Privacy policy and Terms of use

|

Sitemap

© 2024 Hero Vired. All rights reserved