P&S T2 Assessment
P&S T2 Assessment
YEAR : II
SECTION : B
BATCH : 10
REGD NO.s : 211FA04118
211FA04119
211FA04127
211FA04148
AIM :
A health insurance software was tested for meeting the design
specifications by the three different level testers and categorised
the bugs into functional and non functional. Testing of different
modules with respect to the test cases in sequential order. The
software consists of different modules like human resources,
finance, marketing, operations, claims and accounts. All the
modules were tested by different level testers and correspondingly
the errors in the total modules are summarized below:
ALGORITHM :
1. Start
2. Declare a 2D array of size 2x3 and its data type is float
3. Read the values into the array which are functional errors from
unittesters, integration testers and system testers.
4. Read the values into 2nd row of away which are non-functional
errors from unit testers, integration testers and system testers.
5. Store the values of the sum of elements in the array according to
row wise and column wise
6. And also store the Total sum in another variable
7. Now consider a while loop with a true Condition
8. Print the values of array according to their Corresponding names
of rows and columns.
9. After that display menu with three options, option ‘1’ with Can you
infer that level of testers is independent of categorization of bugs and
'2' with Discuss about Pvalue. and it 3' then exit.
10 if option = 1, then find the expected values for each type of bugs
and for each tester and store it a new 2d array of float datatype
11) calculate chisquare value by using formula chisquare =
sigma((original-expected) ^2/ expected)
12) Consider the table value of chisquare at 2 degrees of freedom as it
has 2 rows and 3 columns at 5% level of significance and store it in
chisquare 2 as chisquare 225.991
13) If chisqure<chisqure2 then print we accept H0,else print reject
H0.
14) if option = 2 then Calculate chisquare value as same as above and
find the normal probability area of Calculated chisquare value and
store it in normal as normal = 0.5973
15: 4+ option is equals to 2 then find the chisqure value. and consider
normal = 0.5973
16) Calculate the Pvalue which is equals to P = 2* C1-normal);
17 if P value is greater than 0.05 then Ho, else we reject Ho We
Accept
18) If option is equal to Loop 3 then exit from the
19) elso the process needs to be Continued
20) stop
FLOW CHART :
START
Declare a[2][3]
A[0][0],a[1][0]
Read integration
testers a[0][1],a[1][1]
A[0][2],a[1][2]
Source code :
#include<stdio.h>
#include<math.h>
int main()
{
float a[2][3];
int x,i,j;
printf("enter functional errors from unittesters:");
scanf("%from",&a[0][0]);
printf("enter functional errors from integrationtesters:");
scanf("%f",&a[0][1]);
printf("enter functional errors from systemtesters:");
scanf("%f",&a[0][2]);
printf("enter Non-functional errors from unittesters:");
scanf("%f",&a[1][0]);
printf("enter Non-functional errors from integrationtesters:");
scanf("%f",&a[1][1]);
printf("enter Non-functional errors from systemtesters:");
scanf("%f",&a[1][2]);
float tf=a[0][0]+a[0][1]+a[0][2];
float tnf=a[1][0]+a[1][1]+a[1][2];
float tu=a[0][0]+a[1][0];
float ti=a[0][1]+a[1][1];
float ts=a[0][2]+a[1][2];
float total=tf+tnf;
while(1){
printf("The values are:\n");
printf(" Bugs
\tUnittesters\tintegrationtesters\tsystemtesters\n");
printf(" FUNCTIONAL \t%f\t%f\t\t%f\n",a[0][0],a[0][1],a[0][2]);
printf("NONFUNCTIONAL\t%f\t%f\t\t%f\n",a[1][0],a[1][1],a[1][2])
;
printf("1.Can you infer that level of testers is independent of
categorization of bugs in the software?\n");
printf("2.Discuss about the P-value?\n");
printf("3.Exit\n");
printf("enter option:");
scanf("%d",&x);
if(x==1)
{
printf(" Bugs
\tUnittesters\tintegrationtesters\tsystemtesters\t\tTotal\n");
printf(" FUNCTIONAL
\t%f\t%f\t\t%f\t\t%f\n",a[0][0],a[0][1],a[0][2],tf);
printf("NONFUNCTIONAL\t%f\t%f\t\t%f\t\t%f\n",a[1][0],a[1][1],
a[1][2],tnf);
printf(" Total \t%f\t%f\t\t%f\t\t%f\n",tu,ti,ts,total);
printf("H0=The level of testers is independent of categorization
of bugsin software\n");
printf("H1=The level of testers is dependent of categorization of
bugs\n");
float b[2][3];
b[0][0]=(tf*tu)/total;b[0][1]=(tf*ti)/total;b[0][2]=(tf*ts)/total;
b[1][0]=(tnf*tu)/total;b[1][1]=(tnf*ti)/total;b[1][2]=(tnf*ts)/total;
float chisquare=0,chisquare2=5.991;
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
float y=pow((a[i][j]-b[i][j]),2)/b[i][j];
chisquare+=y;
}
}
printf("The calculated chisquare value is:%f\n",chisquare);
printf("The table value of chisquare with degree of freedom of 2
at 0.05 level significance is:%f\n",chisquare2);
if(chisquare<chisquare2)
{
printf("Therefore,The calculated value of chisquare is less
than table value of chisquare with degree of freedom of 2 at 0.05 level
significance\n");
printf("we accept H0\n");
printf("The level of testers is independent of categorization of
bugsin software\n");
}
else
{
printf("Therefore,The calculated value of chisquare is greater
than table value of chisquare with degree of freedom of 2 at 0.05 level
significance\n");
printf("we reject H0\n");
printf("The level of testers is dependent of categorization of
bugsin software\n");
}
}
else if(x==2)
{
printf(" Bugs
\tUnittesters\tintegrationtesters\tsystemtesters\t\tTotal\n");
printf(" FUNCTIONAL
\t%f\t%f\t\t%f\t\t%f\n",a[0][0],a[0][1],a[0][2],tf);
printf("NONFUNCTIONAL\t%f\t%f\t\t%f\t\t%f\n",a[1][0],a[1][1],
a[1][2],tnf);
printf(" Total \t%f\t%f\t\t%f\t\t%f\n",tu,ti,ts,total);
printf("H0=The level of testers is independent of categorization
of bugsin software\n");
printf("H1=The level of testers is dependent of categorization of
bugs\n");
float b[2][3];
b[0][0]=(tf*tu)/total;b[0][1]=(tf*ti)/total;b[0][2]=(tf*ts)/total;
b[1][0]=(tnf*tu)/total;b[1][1]=(tnf*ti)/total;b[1][2]=(tnf*ts)/total;
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
printf("%f ",b[i][j]);
}
}
float chisquare=0,normal=0.5973;
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
float y=pow((a[i][j]-b[i][j]),2)/b[i][j];
chisquare+=y;
}
}
printf("The calculated chisquare value is:%f",chisquare);
printf("The normal probability area value for calculated chi
square values is:%f",normal);
printf("As the given test is two tailed test,the value of p is two
times the original value\n");
float P=2*(1-normal);
printf("therefore,P=%f\n",P);
if(P>0.05)
{
printf("The P avlue is greater than level of significance,we
Accept H0\n");
printf("The level of testers is independent of categorization of
bugsin software\n");
}
else
{
printf("The P avlue is lesser than level of significance,we
reject H0\n");
printf("The level of testers is dependent of categorization of
bugsin software\n");
}
}
else if(x==3)
{
break;
}
}
}
Test Cases :
enter functional errors from unittesters:25
enter functional errors from integrationtesters:15
enter functional errors from systemtesters:18
enter Non-functional errors from unittesters:20
enter Non-functional errors from integrationtesters:10
enter Non-functional errors from systemtesters:12
The values are:
Bugs Unittesters integrationtesters systemtesters
FUNCTIONAL 25.000000 15.000000 18.000000
NONFUNCTIONAL 20.000000 10.000000 12.000000
1.Can you infer that level of testers is independent of categorization
of bugs in the software?
2.Discuss about the P-value?
3.Exit
enter option:1
Bugs Unittesters integrationtester systemtesters Total
FUNCTIONAL 25.000000 15.000000 18.000000 58.000000
NON FUNCTIONA L 20.000000 10.000000 12.000000 42.000000
Total 45.000000 25.000000 30.000000 100.000000
H0=The level of testers is independent of categorization of bugsin software
H1=The level of testers is dependent of categorization of bugs
The calculated chisquare value is:0.200693
The table value of chisquare with degree of freedom of 2 at 0.05 level significance
is:5.991000
Therefore,The calculated value of chisquare is less than table value of chisquare
with degree of freedom of 2 at 0.05 level significance
we accept H0
The level of testers is independent of categorization of bugsin software
The values are:
Bugs Unittesters integrationtesters systemtesters
FUNCTIONAL 25.000000 15.000000 18.000000
NONFUNCTIONAL 20.000000 10.000000 12.000000
1.Can you infer that level of testers is independent of categorization of bugs in
the software?
2.Discuss about the P-value?
3.Exit
enter option:2
Bugs Unittesters integrationtesters systemtesters Total
FUNCTIONAL 25.000000 15.000000 18.000000 58.000000
NONFUNCTIONA 20.000000 10.000000 12.000000 42.000000
Total 45.000000 25.000000 30.000000 100.000000
H0=The level of testers is independent of categorization of bugsin software
H1=The level of testers is dependent of categorization of bugs
26.100000 14.500000 17.400000 18.900000 10.500000 12.600000 The calculated
chisquare value is:0.200693The normal probability area value for calculated chi
square values is:0.597300As the given test is two tailed test,the value of p is two
times the original value
therefore,P=0.805400
The P avlue is greater than level of significance,we Accept H0
The level of testers is independent of categorization of bugsin software
The values are:
Bugs Unittesters integrationtesters systemtesters
FUNCTIONAL 25.000000 15.000000 18.000000
NONFUNCTIONAL 20.000000 10.000000 12.000000
1.Can you infer that level of testers is independent of categorization of bugs in
the software?
2.Discuss about the P-value?
3.Exit
enter option:3