Pages

Thursday, 16 May 2013

C code for Intermediate Cocomo Model


The basic COCOMO model allowed for a quick and rough estimate, but it resulted in a lack of accuracy. Boehm introduced an additional set of 15 predictors called “cost drivers” in the intermediate model to take account of the software development environment. Cost drivers are used to adjust the nominal cost of the project to the actual project environment, hence increasing the accuracy of the estimate. The cost drivers are grouped into four categories:

1. Product attributes

(a) Required software reliability
(b) Size of application database
(c) Complexity of the product

2. Hardware attributes

(a) Run-time performance constraints
(b) Memory constraints
(c) Volatility of the virtual machine environment
(d) Required turnabout time

3. Personnel attributes

(a) Analyst capability
(b) Software engineering capability
(c) Applications experience
(d) Virtual machine experience
(e) Programming language experience 

4. Project attributes

(a) Use of software tools
(b) Application of software engineering methods
(c) Required development schedule

Each cost driver is rated for a given project environment. The rating uses a scale very low, low, nominal, high, very high, extra high which describes to what extends the cost driver applies to the project being estimated. Table given below, gives the multiplier values for the 15 cost drivers and their rating provided by Boehm.

Intermediate COCOMO Model cost drivers

The multiplying factors for all 15 cost drivers are multiplied to get the effort adjustment factor(EAF). Typical values for EAF range from 0.9 to 1.4. The Intermediate COCOMO model equations take the form: 

E=ai(KLoC)(bi).EAF

D=ci(E)di

Where co-efficients ai and  bi  are given below in table:

Intermediate COCOMO Model Co-efficients

And ci and di uses  in the same way as in the Basic COCOMO.

//C program to calculate effort, development time, productivity and average staff required in Intermediate cocomo model//


#include<stdio.h>
#include<conio.h>
#include<math.h>

int fround(float x)
{
  int a;
  x=x+0.5;
  a=x;
  return(a);
}

void main()
{
  float table[3][4]={3.2,1.05,2.5,0.38,3.0,1.12,2.5,0.35,2.8,1.20,2.5,0.32};
  int i,j,size,model,rating;
  char mode[][15]={"Organic","Semi-Detached","Embedded"};
  char driver[15][6]={"RELY","DATA","CPLX","TIME","STOR","VIRT","TURN","ACAP","AEXP","PCAP",
  "VEXP","LEXP","MODP","TOOL","SCED"};

  float effort,EAF,a,time,staff,productivity;
  float costdrivers[15][6]={

                {0.75,0.88,1,1.15,1.40,-1},

                {-1,0.94,1,1.08,1.16,-1},

                {0.70,0.85,1,15,1.30,1.65},

                {-1,-1,1,1.11,1.30,1.66},

                {-1,-1,1,1.06,1.21,1.56},

                {-1,0.87,1,1.15,1.30,-1},

                {-1,0.87,1,1.07,1.15,-1},

                {1.46,1.19,1,0.86,0.71,-1},

                {1.29,1.13,1.00,0.91,0.82,-1},

                {1.42,1.17,1,0.86,0.70,-1},

                {1.21,1.10,1,0.90,-1,-1},

                {1.14,1.07,1,0.95,-1,-1},

                {1.24,1.10,1.00,0.91,0.82,-1},

                {1.24,1.10,1,0.91,0.83,-1},

                {1.23,1.08,1,1.04,1.10,-1}

                };

  clrscr();

  printf("\nEnter the size of project : ");

  scanf("%d",&size);

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

    model=0;

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

    model=1;

  else if(size>300)

    model=2;

  printf("\nMode = %s",mode[model]);

  EAF=1;

  for(i=0;i<15;i++)

  {

    do

    {

    printf("\nRate cost driver %s on scale of 0-5 : ",driver[i]);

    printf("\n0-Very Low\t1-Low\t2-Nominal\t3-High\t4-Very High\t5-Extra High\n");

    scanf("%d",&rating);

    a=costdrivers[i][rating];

    if(a==-1)

    {

       printf("\nNo value exist for this rating..Enter another rating...\n");

    }

    }while(a==-1);

    EAF=EAF*a;

  }

  printf("\nEAF = %f",EAF);

  effort=(table[model][0]*pow(size,table[model][1])) * EAF;

  time=table[model][2]*pow(effort,table[model][3]);

  staff=effort/time;

  productivity=size/effort;

  printf("\n\nEffort = %f Person-Month",effort);

  printf("\nDevelopment Time = %f Months",time);

  printf("\nAverage Staff Required = %d Persons",fround(staff));

  printf("\nProductivity = %f KLOC/Person-Month",productivity);

getch();
}

Comment your valuable feedback related to this program.

Related Post:-
1. C code to implement Basic Cocomo Model
2. C code to implement Detailed Cocomo Model
3. C code to implement stage-1 of Cocomo-2 Model
4. C code to implement stage-2 of Cocomo-2 Model
5. C code to implement stage-3 of Cocomo-2 Model

No comments:

Post a Comment

Back to Top