Académique Documents
Professionnel Documents
Culture Documents
IT-313
By
Rishita Jaggi
1140213
B.Tech. Third Year IT-3
Submitted to
Course Coordinator: Dr. BB Gupta
Scenario A Railways reservation software was delivered to the customer and was installed in
one of the metro station at 12.00 AM (mid-night) as per the plan. The system worked quite
fine till the next day 12.00 PM (noon). The system crashed at 12.00 PM and the railways
authorities could not continue using software for reservation till 02.00 M. It took two hours to
fix the defect in the software in the software.
Scenario B A polar satellite launch vehicle was scheduled for the launch on August 15th. The
auto-pilot of the rocket to be delivered for integration of the rocket on may 15 th. The design
and development of the software for the auto-pilot more effort because of which the auto-
pilot was delivered for the integration on June 15th (delayed by a month). The rocket was
launched on Sep 15th (delayed by a month).
Scenario C Software for financial systems was delivered to the customer. Customer
informed the development team about a mal-function in the system. As the software was
huge and complex, the development team could not identify the defect in the software.
Scenario D Due to the defect in the software for the baggage handling system. There was
also of & 2M of revenues for the airport authorities.
Solution:
Scenario Situation
A Failure at customer site.
B Time slippage
C Intractable Error after delivery
D Cost Slippage
EXPERIMENT 3
(Software Development Model)
Objective:
To identify the suitable software development model for the given scenario.
Background:
ABC is a new enterprise recently started by a few young entrepreneurs, intended to develop
robotic systems using IT based solutions. TENZ is a well-established automobile
manufacturing plant, interested in automating some of the operations of the plant. As first
step towards automation, TENZ has decided to deploy a robotic arm to pick and place large
number of bolts from one tray of a conveyer belt to another tray of a different conveyer belt,
moving one bolt at a time. TENZ has asked ABC for demonstration the robotic arm for the
said purpose as a proof of concept. This is the first project being executed by ABC. TENZ
would like to have a first experience of the robotic arm before signing the MOU
(Memorandum of Understanding) with ABC. After MOU sign-off, TENZ would provide the
complete set of requirement of the robot.
Problem description:
Identify the most appropriate SDLC model for this scenario.
Solution:
For the given scenario, taking in light all the initial problems, it can be concluded that the
appropriate model for the development of the robotic system is PROTOTYPE MODEL.
Prototype model is one of the evolutionary models which is used when the requirements are
not clear and complete in the initial stage of software development. It is used when the final
product is to be delivered only once with full functionality with completion of small
functionalities in each continuing steps. According to the prototype model, first the simple
prototype is delivered to the customers, who are then evaluated and final SRS is made by the
customers. Thus, after the evaluation of the prototype all the requirements are finalized and
then only the real development of the software is started. Given scenario have similar
conditions with the robotic arm as the prototype. After evaluation of the arm by TENZ the
final requirements are framed and MOU is signed off. Then, the ABC team will work with
development of robotic system. Thus, the appropriate model is prototype model.
EXPERIMENT 4
Requirement engineering produces a specification of what a system should do. The intention
of requirement engineering is to provide a clear definition of requirement of the systems. This
phase is a very important phase because, if the customer requirements are not clearly
understood, the ambiguity can get into the other phase of the development. To avoid such
issues, requirement has to be elicited using the right elicitation techniques, to be analysed
effectively, specified clearly and verified thoroughly.
All activities are collectively termed as requirement development activities.
Objective: To identify the various elicitation techniques and their usage for the banking
case study.
THEORY: Functional requirements specify the software functionality that the developer
must build into the product to enable users to accomplish their tasks. Non functional
requirements are related to the system as whole rather than to individual functions. Failure to
meet a functional requirement degrades the system while failure to meet a non functional
requirement may make the whole system unusable.
SCENARIO:
PROBLEM OVERVIEW: AS, a giant books franchise has approached IT company ABC
Ltd. to automate its processes and shift them online. ABC Ltd agrees to take on the project
and, both the companies sits down and strikes a deal. After detailed discussion ABC Ltd
decides to follow water fall model for development of the project. The concerned team at
ABC designed and developed the SRS. Which of these are expected to be present in the SRS?
Flow Charts for algorithms realizing the functionality of the system Not required as it comes under
designing part.
THEORY: Integration testing is carried out after the completion of unit testing and before
the software is delivered for system testing. In top down integration testing, dummy stubs are
required. Similarly in bottom up testing, dummy drivers are required for top level modules.
SITUATIONS:
1: Except the Ticket_validation_Unit, the coding and unit testing of all other modules, sub
modules and units of TMS are completed. The top-down integration is in progress for the
TMS software. To carry out the integration testing, which among the following is necessary?
A Stub for Ticket_Validation_Unit
A Driver For Ticket_Validation_Unit
A Stub for Enquiry_Module
A Driver for Enquiry_Module
A Stub For Ticket_Booking_Module
A Driver For Ticket_Booking_Module
ANS: Stub for Ticket_Validation_Unit
2: The coding and unit testing of all the module, sub modules and units of TMS are
completed except the Update_Module (coding and testing for Edit_Module, Cancel_Module
and View_Module are also completed). The bottom-up integration is to be started for the
TMS software. Mention any stub or driver needed to carry out the integration testing?
ANS: Driver for update module.
3: Except the Taxi_Booking_Module, the coding and unit testing of all other modules, sub
modules and units of TMS are completed. The top-down integration is to be started for the
TMS software. Mention any stub or driver needed to carry out the integration testing?
ANS: Stub for taxi booking module.
EXPERIMENT 10
(Performance Testing)
AIM: Identify the different types of performance testing
THEORY: Performance testing tests the non-functional requirements of the system. The
different types of performance testing are load testing, stress testing, endurance testing and
spike testing.
PROBLEM DESCRIPTION: Identify the type of performance testing for the following:
Background Enhancements are introduction of new features to the software and might be
released in different versions. Whenever a version is released, regression testing should be
done on the system to ensure that the existing features have not been disturbed.
Ans-True
2. The incorporation of minor changes would have introduced new bugs into other modules,
so regression testing should be carried out.
Ans-True
3. Since the acceptance testing is already carried out, it is enough if the team performs sanity
testing on the Enquire module.
Ans-True
Solution:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
typedef struct {
short int plus;
short int minus;
short int multiply;
short int modulo;
short int division;
short int and;
short int or;
short int not;
}operator;
typedef struct{
short int number_of_int;
short int number_of_float;
short int number_of_char;
short int number_of_file;
}operand;
operator op;
operand opd;
int n1=0,N1=0,n2=0,N2=0;
void find_operators(char *filename)
{
FILE *fs;
char ch;
fs=fopen(filename,"r+");
if(fs==NULL)
{
printf("File Not Found");
exit(EXIT_FAILURE);
}
while(1)
{
ch=fgetc(fs);
if(ch==EOF)
break;
switch(ch)
{
case '+':
op.plus++;
break;
case '-':
op.minus++;
break;
case '*':
op.multiply++;
break;
case '%':
op.modulo++;
break;
case '/':
op.division++;
break;
case '&':
op.and++;
break;
case '|':
op.or++;
break;
case '!':
op.not++;
break;
}
}
if(op.plus!=0)
n1++;
if(op.minus!=0)
n1++;
if(op.modulo!=0)
n1++;
if(op.division!=0)
n1++;
if(op.multiply!=0)
n1++;
if(op.and!=0)
n1++;
if(op.or!=0)
n1++;
if(op.not!=0)
n1++;
N1=op.plus+op.minus+op.division+op.multiply+op.modulo+op.and+op.or+op.not;
fclose(fs);
}
int cal(FILE *fs, int number,char *str, char ch,char *temp)
{
FILE *ft;
int i,flag,length;
ft=fs;
temp[0]=ch;
length=strlen(str);
// printf("lenght = %d\n",length);
for(i=1;i<=length;i++)
temp[i]=fgetc(ft); //for comparing the strings storing in a temp string
flag=0;
flag=strcmp(temp,str);
if(flag==1)
{
while(1)
{
ch=fgetc(ft);
if(ch==';')
{
number++;
break;
}
if(ch==',')
number++;
}
fs=ft;
}
return number;
}
void distinct_operands(char *filename)
{
FILE *fs,*ft;
char ch,*str_int="int ",*str_float="float ",*str_char="char ",temp[11],*str_file="FILE ";
int i=0,flag;
fs=fopen(filename,"r+");
if(fs==NULL)
{
printf("File Not Found");
exit(EXIT_FAILURE);
}
while(1)
{
ch=fgetc(fs);
if(ch==EOF)
break;
if(str_int[0]==ch)
opd.number_of_int = cal(fs,opd.number_of_int,str_int,ch,temp);
else if(str_float[0]==ch)
opd.number_of_float = cal(fs,opd.number_of_float,str_float,ch,temp);
else if(str_char[0]==ch)
opd.number_of_char = cal(fs,opd.number_of_char,str_char,ch,temp);
else if(str_file[0]==ch)
{
opd.number_of_file = cal(fs,opd.number_of_file,str_file,ch,temp);
}
else if(ch=='\t')
continue;
else if(ch==' ')
continue;
else
{
while(1)
{
if(ch == '\n')
break;
else if(ch==EOF)
goto L;
ch = fgetc(fs);
}
}
}
L:
n2 = opd.number_of_int + opd.number_of_char +
opd.number_of_float+opd.number_of_file;
fclose(fs);
}
void total_operands(char *filename)
{
FILE *fs,*ft,*fe;
static count=0;
char ch,ch1;
fs = fopen(filename, "r+");
if(fs==NULL)
{
printf("FILE CANNOT BE OPENED");
exit(EXIT_FAILURE);
}
while(1)
{
ch=fgetc(fs);
if(ch==EOF)
break;
if(ch=='=')
{
fe = fs;
ch1 = fgetc(fe);
if(ch1=='=')
{
count++;
fs = fe;
continue;
}
count++; // for the operand before the = sign
while(1)
{
ch=fgetc(fs);
switch(ch)
{
case ';':
goto z;
break;
case '+':
case '-':
case '*':
case '/':
case '%':
count++;
}
}
z: count++; // as one operand count will be left so this for that one to add
}
}
N2=count;
fclose(fs);
}
int main()
{
char filename[20],ch;
int N;
double E,V,D,T;
printf("\t\t\t**** HALSTEAD EQUATION ****");
Start:
printf("\n\nEnter the file name\t");
gets(filename);
find_operators(filename);
distinct_operands(filename);
total_operands(filename);
C: printf("\nYou want to enter more file names(y/n)?\t");
scanf("%c",&ch);
fflush(stdin);
switch(ch)
{
case 'Y':
case 'y':
goto Start;
break;
case 'n':
case 'N':
break;
default:
printf("\n\n\t\tWrong Choice\n");
goto C;
}
printf("\nNumber of distinct operators n1= %d",n1);
printf("\n\nTotal operators N1= %d",N1);
printf("\n\nNumber of distinct operands n2= %d",n2);
printf("\n\nTotal operands N2= %d",N2);
printf("\n\nProgram vocabulary n= %d",n1+n2);
N = N1 + N2 ;
printf("\n\nProgram length n= %d",N);
printf("\n\nCalculated program length = %0.5lf",n1*(log10((double)n1)/log10(2))
+n2*(log10((double)n1)/log10(2)));
V = N * ( log10((double)(n1 + n2)) / log10(2) );
printf("\n\nVolume is V=%0.4lf",V);
D = ( n1 * N2 ) / ( double )( 2 * n2 ) ;
printf("\n\nDifficulty is D=%0.4lf",D);
E=D*V;
printf("\n\nEffort is E= %0.4lf",E);
T = E / 18 ;
printf("\n\nTime reqired T= %0.4lf sec",T);
getch();
}
Output:
PROGRAM 2
Objective:
Compute average number of live variables per statement in a program.
Solution:
#include<stdio.h>
#include<stdlib.h>
int total_number_of_lines;
int live_var;
void life_of_var(char *filename)
{
FILE *fs;
char ch;
fs = fopen (filename,"r+");
if(fs==NULL)
{
printf("\nFILE CANNOT BE OPENED ");
exit(EXIT_FAILURE);
}
while(1)
{
ch=fgetc(fs);
if(ch==EOF)
break;
else if(ch=='\n')
total_number_of_lines++;
else if(ch=='"')
{
ch=fgetc(fs);
while(ch!='"')
{
if(ch=='%')
live_var++;
ch=fgetc(fs);
}
}
else if(ch=='=')
{
live_var++;
ch=fgetc(fs);
while(ch!=';')
{
switch(ch)
{
case '+':
case '-':
case '*':
case '%':
case '/':
live_var++;
}
ch=fgetc(fs);
}
live_var++;
}
}
fclose(fs);
}
int main()
{
char filename[10],ch;
printf("\t\t**** Average life of variables ****");
Start:
printf("\n\nEnter the file name\t");
gets(filename);
life_of_var(filename);
C: printf("\nYou want to enter more file names(y/n)?\t");
scanf("%c",&ch);
fflush(stdin);
switch(ch)
{
case 'Y':
case 'y':
goto Start;
break;
case 'n':
case 'N':
break;
default:
printf("\n\n\t\tWrong Choice\n");
goto C;
}
printf("\nNumber of live variavbles %d",live_var);
printf("\nNumber of lines %d",total_number_of_lines);
printf("\nAverage number of live variable %f",(float)live_var/total_number_of_lines);
getch();
}
Output:
PROGRAM 3
Objective:
Compute average life of variables in a program.
Solution:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct {
char str[32];
}total_var;
total_var tv[4000];
int j=0;
int times=0;
FILE* count_var(FILE *fs,int check)
{
char ch,*var;
var = (char*)malloc(20* sizeof(char));
int i=0;
while(1)
{
ch = fgetc(fs);
if(ch == ';')
{
var[i] = '\0' ;
strcpy(tv[j].str,var);
i=0;
j++;
break;
}
else if(ch == ',')
{
var[i] = '\0' ;
strcpy(tv[j].str,var);
i=0;
j++;
}
// else if(ch!=' ' && ch!='\\\t')
else if((ch >='A'&& ch<='Z')|| ch>='a' && ch<='z' )
{
if(i==0&&check==1)
continue;
else
{
var[i] = ch;
i++;
}
}
}
free(var);
return fs;
}
FILE* get_var_type(FILE *fs,char *str)
{
FILE *ft;
ft=fs;
char temp[8];
int check = 0;
if(str[0]=='F')
{
check = 1;
}
temp[0] = str[0];
int p = strlen(str),i;
for(i=1;i<p;i++)
{
temp[i] = fgetc(ft);
}
if(strcmp(temp,str)==0)
{
//puts(str);
// puts(temp);
fs = ft;
fs = count_var(fs,check);
}
return fs;
}
void get_variables(char *filenam)
{
FILE *fs,*ft;
char ch, *str_int = "int ",*str_float = "float ",*str_char = "char ",*str_file = "FILE ";
fs = fopen(filenam,"r+");
if(fs == NULL)
{
printf("FILE CANNOT BE OPENED");
exit(1);
}
while(1)
{
ch = fgetc(fs);
if(str_int[0]==ch)
{
fs = get_var_type(fs,str_int);
}
else if(str_float[0] == ch)
{
fs = get_var_type(fs,str_float);
}
else if(str_char[0] == ch)
{
fs = get_var_type(fs,str_char);
}
else if(str_file[0] == ch)
{
fs = get_var_type(fs,str_file);
}
else if(ch==EOF)
break;
else if(ch=='\t'|| ch==' ')
continue;
else
{
while(1)
{
if(ch == '\n')
break;
else if(ch==EOF)
goto L;
ch = fgetc(fs);
}
}
}
L:
fclose(fs);
}
FILE* get_number_of_time(FILE *fs,char *str)
{
FILE *ft;
ft=fs;
char temp[32];
temp[0] = str[0];
int p = strlen(str),i;
for(i=1;i<p;i++)
{
temp[i] = fgetc(ft);
}
temp[i] = '\0';
if(strcmp(temp,str)==0)
{
fs = ft;
times++;
}
return fs;
}
void average_life(char *filenam)
{
int i=0,f=0;
char ch;
FILE *fs;
A: fs = fopen(filenam,"r");
if(fs==NULL)
{
printf("File not found");
exit(1);
}
while(1)
{
ch = fgetc(fs);
if(tv[i].str[0]==ch)
{
fs = get_number_of_time(fs,tv[i].str);
if(f==0)
{
times--;
f=1;
}
}
else if(ch==EOF)
{
f=0;
break;
}
}
if(f==0 && i<j)
{
fclose(fs);
i++;
goto A;
}
// printf("times = %d",times);
}
int lines(char *filenam)
{
int i=0;
char ch;
FILE *fs;
A: fs = fopen(filenam,"r");
if(fs==NULL)
{
printf("File not found");
exit(1);
}
while(1)
{
ch = fgetc(fs);
if(ch=='\n')
i++;
if(ch==EOF)
break;
}
fclose(fs);
return i;
}
main()
{
char filenam[20],ch;
Start:
printf("\n\nEnter the file name\t");
gets(filenam);
get_variables(filenam);
average_life(filenam);
int l = lines(filenam);
C: printf("\nYou want to enter more file names(y/n)?\t");
scanf("%c",&ch);
fflush(stdin);
switch(ch)
{
case 'Y':
case 'y':
goto Start;
break;
case 'n':
case 'N':
break;
default:
printf("\n\n\t\tWrong Choice\n");
goto C;
}printf("ans is %f",(float)times/l);
getch();
}
Output:
PROGRAM 4
Objective:
To perform boundary value analysis of a program.
Solution:
#include<iostream>
#include<stdlib.h>
int main()
{
int n,a[n],x,c,u[n],m[n],e[n][4];
cout<<"Enter the number of variables";
cin>>n;
e[a1][0] = m[a1];
e[a1][1] = m[a1]+1;
e[a1][2] = u[a1]-1;
e[a1][3] = u[a1];
}
for(int i=1; i<n+1; i++)
{
for(int l=1; l<=i; l++)
{
if(l!=1)
{
cout<<a[l]<<"\t";
}
}
for(int j=0; j<4; j++)
{
cout<<e[i][j];
for(int k=0; k<n-(i+1); k++)
{
cout<<a[k]<<"\t";
}
cout<<"\n";
}
}
system("PAUSE");
return 0;
}
OUTPUT:
PROGRAM 5
Objective:
Compute McCabes cyclomatic complexity of a program.
Solution:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define MAX 10
int main()
{
FILE *fp;
int row,col,i,j,edges,nodes;
char ch;
int mat[MAX][MAX];
// clrscr();
fp=fopen("myfile.txt","r");
row=col=0;
while(fscanf(fp,"%c",&ch)!=EOF)
{
if(ch==' ')
col++;
else if(ch=='\n')
{
row++;
col=0;
}
else
mat[row][col]=ch-48;
}
fclose(fp);
printf("\nThe given adjacency matrix is : \n");
for(i=0;i<=row;i++)
{
for(j=0;j<=col;j++)
printf("%d\t",mat[i][j]);
printf("\n");
}
nodes=row+1;
printf("\nNumber of nodes = %d",nodes);
edges=0;
for(i=0;i<=row;i++)
{
for(j=0;j<=col;j++)
{
if(mat[i][j]==1)
edges++;
}
}
printf("\nNumber of edges = %d",edges);
printf("\n\nCyclometic Complexity of graph = edges-nodes+2p\n");
printf("\t\t\t\t= %d - %d + 2",edges,nodes);
printf("\n\t\t\t\t= %d",edges-nodes+2);
getch();
}
OUTPUT: