0 7

BIT302 ยท 0 ยท 5 marks

Write short notes on: a. COCOMO b. Design Pattern

Write short notes on: a. COCOMO b. Design Pattern [5]

Software EngineeringChapter 8: Design Patterns and ModelingCOCOMO estimation models

Quick answer

COCOMO is an algorithmic software cost estimation model developed by Barry Boehm in 1981. It is used to estimate the effort, time, and cost required to develop a software project based on the size of the software (measured in KLOC - Kilo Lines of Code).

Short Notes

a. COCOMO (Constructive Cost Model)

Types of COCOMO:

1. Basic COCOMO

  • Provides a rough estimate of software development effort.
  • Formula:

Effort (E) = a ร— (KLOC)^b (Person-Months) Time (T) = c ร— (E)^d (Months)

2. Intermediate COCOMO

  • Refines the basic model by introducing cost driver attributes (hardware, personnel, project attributes).
  • More accurate than basic COCOMO.

3. Detailed COCOMO

  • Applies cost drivers at each phase of the software development lifecycle.
  • Most accurate among the three.

Project Categories:

ModeDescriptionExample
OrganicSmall, simple projectsPayroll system
Semi-detachedMedium complexityCompiler design
EmbeddedComplex, tight constraintsReal-time systems

Advantages:

  • Easy to use and understand
  • Provides quantitative estimates

Limitations:

  • Based only on KLOC (does not consider modern development methods)
  • Not suitable for agile or object-oriented projects

b. Design Pattern

A Design Pattern is a general, reusable solution to a commonly occurring problem in software design. It is not a finished design but a template or description of how to solve a problem that can be used in many different situations.

The concept was popularized by the "Gang of Four" (GoF) - Gamma, Helm, Johnson, and Vlissides in their book "Design Patterns: Elements of Reusable Object-Oriented Software" (1994).

Types of Design Patterns:

1. Creational Patterns

  • Deal with object creation mechanisms.
  • Examples: Singleton, Factory, Abstract Factory, Builder, Prototype

2. Structural Patterns

  • Deal with object composition and structure.
  • Examples: Adapter, Bridge, Composite, Decorator, Facade

3. Behavioral Patterns

  • Deal with communication and responsibility between objects.
  • Examples: Observer, Strategy, Command, Iterator, Template Method

Benefits of Design Patterns:

  • Promotes code reusability and maintainability
  • Provides a common vocabulary for developers
  • Speeds up the development process
  • Helps in writing flexible and scalable code

Example - Singleton Pattern:

Ensures that a class has only one instance and provides a global point of access to it.

class Singleton {
    private static Singleton instance;
    private Singleton() {}
    public static Singleton getInstance() {
        if (instance == null)
            instance = new Singleton();
        return instance;
    }
}

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.