STQA File
STQA File
printf("a=%d,\tb=%d,\tc=%d\n", a, b, c);
if (istriangle == 'y')
{
if ((a == b) && (b == c))
printf("Equilateral triangle\n");
else if ((a != b) && (a != c) && (b != c))
printf("Scalene triangle\n");
else
printf("Isosceles triangle\n");
}
else
{
printf("Not a triangle\n");
}
return 0;}
1
Experiment Number : 1
Brief Description : Check whether given value for a equilateral, isosceles , Scalene triangle or
can't from a triangle
Input Data
Case Description Expected Output Actual Status
a b C
Id Output
Message should be
Enter the value of a, b and c
1 20 5 5 displayed can't form
Such that a is not less than sum
a
of two sides
triangle
Enter the value of a, b and c Message should be
2 Such that b is not less than sum 3 15 11 displayed can't form
of two sides and a is less than a
sum of other two sides triangle
2
Enter the value of a, b and c
Message should be
Such that c is not less than sum
3 4 5 20 displayed can't form
of two sides and
a triangle
a and b is less than sum of
other two sides
Should display the
Enter the value a, b and c
4 5 5 5 message
satisfying precondition and
Equilateral
a=b, b=c and c=a
triangle
Should display the
Enter the value a ,b and c
5 10 10 9 message Isosceles
satisfying precondition and a=b
triangle
and b ≠ c
Enter the value a, b and c Should display the
6 5 6 7
satisfying message Scalene triangle
precondition and a ≠b , b ≠ c and
c≠a
3
Program 2 (Boundary value analysis program)
/* Design and develop a program in a language of your choice to solve the triangle problem
defined as follows : Accept three integers which are supposed to be the three sides of triangle and
determine if the three values represent an equilateral triangle, isosceles triangle, scalene triangle,
or they do not form a triangle at all. Derive test cases for your program based on boundary value
analysis, execute the test cases and discuss the results */
#include <stdio.h>
int main()
{
int a, b, c, c1, c2, c3;
char istriangle;
do
{
printf("\nEnter 3 integers which are sides of triangle:\n");
scanf("%d%d%d", &a, &b, &c);
if (!c1)
printf("\nThe value of a = %d is not in the range of permitted value", a);
if (!c2)
printf("\nThe value of b = %d is not in the range of permitted value", b);
if (!c3)
printf("\nThe value of c = %d is not in the range of permitted value", c);
if (istriangle == 'y')
{
if (a == b && b == c)
printf("Equilateral triangle\n");
4
else if ((a != b) && (a != c) && (b != c))
printf("Scalene triangle\n");
else
printf("Isosceles triangle\n");
}
else
{
printf("Not a triangle\n");
}
return 0;
}
Experiment Number : 2
Test Case Name :Boundary Value Analysis for triangle
Problem
Test Data : Enter the 3 Integer Value( a , b And c )
Pre-condition : 1 ≤ a ≤ 10 , 1 ≤ b ≤ 10 and 1 ≤ c ≤ 10 and a < b + c , b < a + c and c < a + b
Brief Description : Check whether given value for a equilateral, isosceles , Scalene triangle or
can't from a triangle
Input
Actu
Case Description Data Expected Output Statu
al
Id Outp s
A b c
ut
Should display the message
1 Enter the min value for a , b and 1 1 1
Equilateral
c
triangle
Enter the min value for 2 items Message should be displayed can't
2 1 1 2
and form a
min +1 for any one item1 triangle
Enter the min value for 2 items Message should be displayed can't
3 1 2 1
and min +1 for any one form a triangle
item1
Enter the min value for 2 items Message should be displayed can't
4 2 1 1
and min +1 for any one form a triangle
item1
Enter the normal value for 2 Should display the message
5 5 5 1
items and 1 item is min Isosceles triangle
5
value
6
Program 3 (equivalence class partitioning program)
/* Design and develop a program in a language of your choice to solve the triangle problem defined
as follows : Accept three integers which are supposed to be the three sides of triangle and determine
if the three values represent an equilateral triangle, isosceles triangle, scalene triangle, or they do not
form a triangle at all. Derive test cases for your program based on equivalence class partitioning ,
execute the test cases and discuss the results */
#include <stdio.h>
int main()
{
int a, b, c, c1, c2, c3;
char istriangle;
do
{
printf("\nEnter 3 integers which are sides of triangle:\n");
scanf("%d%d%d", &a, &b, &c);
printf("\na=%d\tb=%d\tc=%d\n", a, b, c);
if (!c1)
printf("\nThe value of a=%d is not in the range of permitted value", a);
if (!c2)
printf("\nThe value of b=%d is not in the range of permitted value", b);
if (!c3)
printf("\nThe value of c=%d is not in the range of permitted value", c);
if (istriangle == 'y')
{
if (a == b && b == c)
printf("Equilateral triangle\n");
else if ((a != b) && (a != c) && (b != c))
printf("Scalene triangle\n");
else
printf("Isosceles triangle\n");}
else { printf("Not a triangle\n"); } return 0;}
7
Experiment Number : 3
Test Case Name :Equivalence class Analysis for triangle problem
8
Strong Robust Equivalence class Testing
Enter one invalid input Should display value of a is not
11 -1 5 5
and two in the
valid value for a , b and c range of permitted values
Enter one invalid input Should display value of a is not
12 5 -1 5
and two in the
valid value for a , b and c range of permitted values
Enter one invalid input Should display value of a is not
13 5 5 -1
and two in the
valid value for a , b and c range of permitted values
Should display value of a is not
Enter two invalid input in the
14 -1 -1 5 range of permitted values
and two valid value
for a , b and c Should display value of b is
not in the
range of permitted values
Should display value of b is
Enter two invalid input not in the
14 5 -1 -1 range of permitted values
and two valid value
for a , b and c Should display value of c is not
in the
range of permitted values
Should display value of a is not
Enter two invalid input in the
14 -1 5 -1 range of permitted values
and two valid value
for a , b and c Should display value of c is not
in the
range of permitted values
Should display value of a is not
in the
range of permitted values
15 Enter all invalid -1 -1 -1 Should display value of b is
inputs not in the
range of permitted values
Should display value of c is not
in the
range of permitted values
9
Program 4: (Dataflow Testing for commission calculation)
#include<stdio.h>
int main()
{
int locks, stocks, barrels, tlocks, tstocks, tbarrels;
float lprice,sprice,bprice,lsales,ssales,bsales,sales,comm;
lprice=45.0;
sprice=30.0;
bprice=25.0;
tlocks=0;
tstocks=0;
tbarrels=0;
printf("\nenter the number of locks and to exit the loop enter -1 for locks\n");
scanf("%d", &locks);
while(locks!=-1) {
printf("enter the number of stocks and barrels\n");
scanf("%d%d",&stocks,&barrels);
tlocks=tlocks+locks;
tstocks=tstocks+stocks;
tbarrels=btarrels+barrels;
printf("\nenter the number of locks and to exit the loop enter -1 for locks\n");
scanf("%d",&locks);
}
printf("\ntotal locks = %d\”,tlocks);
printf(“total stocks =%d\n”,tstocks);
printf(“total barrels =%d\n",tbarrels);
lsales = lprice*tlocks;
ssales=sprice*tstocks;
bsales=bprice*tbarrels;
sales=lsales+ssales+bsales;
printf("\nthe total sales=%f\n",sales);
if(sales > 1800.0)
{
comm=0.10*1000.0;
comm=comm+0.15*800;
comm=comm+0.20*(sales-1800.0);
}
else if(sales > 1000)
{
comm =0.10*1000;
comm=comm+0.15*(sales-1000);
}
else
10
comm=0.10*sales;
printf("the commission is=%f\n",comm);
return 0;
}
Experiment No : 4
Test Case Name : Data Flow Testing for Commission Program
Precondition : Enter -1 for locks to exit from input loop Brief
Description : Enter the locks, stocks and barrels > 0
11
Selected Define/Use Paths for Commission problem
Test variables
Definiti
case Description path(Begin Du paths Comme
on
id ning, End nts
clear
nodes)
?
Check for lock price variable <7-8-9-10-11-12-13-14-15-
1 (7 , 24) Yes
DEF(lprice,7) and 16-17-
USE(lprice,24) 18-19-20-21-22-23-24>
Check for Stock price variable <8-9-10-11-12-13-14-15-16-
2 (8 , 25) Yes
DEF(sprice,8) and 17-18-
USE(sprice,25) 19-20-21-22-23-24-25>
Check for barrel price variable <9-10-11-12-13-14-15-16-
3 (9 , 26) Yes
DEF(bprice,9) and 17-18-
USE(bprice,26) 19-20-21-22-23-24-25-26>
(10 , 16) <10-11-12-13-14-15-16> Yes
<10-11-12-13-14-15-16-17-
(10 , 21) No
18-19-
Check for total locks variable 20-14-21>
DEF((tlocks,10) and
4 <10-11-12-13-14-15-16-17-
DEF(tlocks,16)) and 3 usage (10 , 24) No
18-19-
node(USE(tlocks,16),USE(tlocks,21),
20-14-21-22-23-24>
USE(tlock s,24)
(16 , 16) <16-16> Yes
(16 , 21) <16-17-18-19-14-21> No
12
Begin the
(13 , 14) <13-14> Yes
loop
check for locks variable
( 13 , 16) <13-14-15-16> Yes
6 ( DEF(locks,13)
,DEF(locks,19) (19 , 14) <19-20-14> Yes
and Repeat
(19 , 16) <19-20-14-15-16> Yes
USE(locks,14), the
USE(locks,16) loop
Check for stocks variable
7 (15 , 17) <15-16-17> Yes
(DEF(stocks,15) and
USE(stocks,17)
(27 ,28) <27-28> Yes
Check for sales DEF(sales, 27) and (27 , 29) <27-28-29> Yes
USE(Sales, 28), USE(Sales , 29), (27 , 33) <27-28-29-30-31-32-33> Yes
8
USE(Sales,33) , (27 , 34) <27-28-29-34> Yes
USE(Sales , 34) , USE(Sales,37) ,
(27 , 37) <27-28-29-34-35-36-37> Yes
USE(Sales , 39)
(27 , 39) <27-28-29-34-38-39> Yes
( (31,32,33),42) <31-32-33-42> Yes
Check for Commission variable
9 DEF(comm, 31,32,33) , ((34 , 35) , 42) <34-35-42> Yes
DEF(comm,34,35) and ((39 , 42 ) <39 - 42> Yes
DEF(comm,39) and
USE(comm,42)
13
Program 5, 6 and 7 ( Boundary , Equivalence and Decision Test Case for
Commission Problem)
/* Design. develop, code and run the program in nay suitable language to solve the commission
problem. Analyze it from the perspective of boundary value, derive test cases, execute these test
cases and discuss the test results */
/* Assumption price for lock=45.0, stock=30.0 and barrels=25.0 production limit could sell in a
month 70 locks,80 stocks and 90 barrels commission on sales = 10 % <= 1000 and 15 % on 1000
to 1800 and 20 % on above 1800*/
#include <stdio.h>
int main()
{
int locks, stocks, barrels, tlocks, tstocks, tbarrels;
float lprice, sprice, bprice, sales, comm;
int c1, c2, c3, temp;
lprice = 45.0;
sprice = 30.0;
bprice = 25.0;
tlocks = 0;
tstocks = 0;
tbarrels = 0;
printf("\nEnter the number of locks and to exit the loop enter -1 for locks\n");
scanf("%d", &locks);
if (c1)
printf("Value of locks not in the range 1..70\n");
else
{
14
temp = tlocks + locks;
if (temp > 70)
printf("New total locks = %d not in the range 1..70 so old\n", temp);
else
tlocks = temp;
}
if (c2)
printf("Value of stocks not in the range 1..80\n");
else
{
temp = tstocks + stocks;
if (temp > 80)
printf("New total stocks = %d not in the range 1..80 so old\n", temp);
else
tstocks = temp;
}
if (c3)
printf("Value of barrels not in the range 1..90\n");
else
{
temp = tbarrels + barrels;
if (temp > 90)
printf("New total barrels = %d not in the range 1..90 so old\n", temp);
else
tbarrels = temp;
}
printf("\nEnter the number of locks and to exit the loop enter -1 for locks\n");
scanf("%d", &locks);
}
printf("\nTotal locks = %d\nTotal stocks = %d\nTotal barrels = %d\n", tlocks, tstocks, tbarrels);
15
sales = lprice * tlocks + sprice * tstocks + bprice * tbarrels;
printf("\nThe total sales = %f\n", sales);
if (sales > 0)
{
if (sales > 1800.0)
{
comm = 0.10 * 1000.0;
comm += 0.15 * 800;
comm += 0.20 * (sales - 1800.0);
}
else if (sales > 1000)
{
comm = 0.10 * 1000;
comm += 0.15 * (sales - 1000);
}
else
comm = 0.10 * sales;
return 0;
}
16
Experiment Number : 5
Checking boundary value for locks, stocks and barrels and commission
Commission Problem Output Boundary Value Analysis Cases
Input Data Expected Actual
Case Output output Sta
Description
Id t
Tota Total Total Co Com
Sales Sale u Comment
l Stock Barrel m m
s s
Lock s s m- -
s issi ission
on
1 Enter the min value for locks, stocks 1 1 1 100 10 output minimum
and barrels
2 1 1 2 125 12.5 output
Enter the min value for 2 items and minimum +
min +1 for any one
3 1 2 1 130 13 output
item minimum +
4 2 1 1 145 14.5 output
minimum +
Enter the value sales approximately
5 mid value 5 5 5 500 50 Midpoint
between 100 to 1000
6 10 10 9 975 97.5 Border point -
Enter the values to calculate the
7 commission for sales nearly 10 9 10 970 97 Border point -
8 less than 1000 9 10 10 955 95.5 Border point -
9 Enter the values sales exactly equal to 10 10 10 1000 100 Border point
1000
10 10 10 11 1025 103.75 Border point +
Enter the values to calculate the
11 10 11 10 1030 104.5 Border point +
commission for sales nearly
12 greater than 1000 11 10 10 1045 106.75 Border point +
17
14 Enter the values to calculate the 18 18 17 1775 216.25 Border point
-
commission for sales nearly
15 18 17 18 1770 215.5 Border point
less than 1800 -
16 17 18 18 1755 213.25 Border point
-
17 Enter the values sales exactly equal to 18 18 18 1800 220 Border
1800 point
18 18 18 19 1825 225 Border point
Enter the values to calculate the +
19 commission for sales nearly 18 19 18 1830 226 Border point
greater than 1800 +
20 19 18 18 1845 229 Border point
+
Enter the values normal value for lock,
21 stock and 48 48 48 4800 820 Midpoint
barrel
22 70 80 89 7775 1415 Output
Enter the max value for 2 items and maximum -
max - 1 for any one
23 item 70 79 90 7770 1414 Output
maximum -
24 69 80 90 7755 1411 Output
maximum -
18
Experiment Number : 6
Test Case Name :Equivalence Class for Commission Problem
Test data : price Rs for lock - 45.0 , stock - 30.0 and barrel - 25.0
sales = total lock * lock price + total stock * stock price + total barrel * barrel price
commission : 10% Upto sales Rs 1000 , 15 % of the next Rs 800 and 20 % on any sales in
excess of 1800
Pre-condition : lock = -1 to exit and 1< =lock < = 70 , 1<=stock <=80 and 1<=barrel<=90
Brief Description: The salesperson had to sell at least one complete rifle per month.
Checking boundary value for locks,stocks and barrels and
commission
Valid Classes
L1 ={LOCKS :1 <=LOCKS<=70}
L2 ={Locks=-1}(occurs if locks=-1 is used to control input iteration)
L3 ={stocks : 1<=stocks<=80}
L4= {barrels :1<=barrels<=90}
Invalid Classes
19
Weak Robustness equivalence Class
Cas Input Data St
Description Expected Output Actual Comm
e a
Locks Stock Barrel output ent
Id t
s s u
s
20
Strong Robustness equivalence Class
Case Input S
Description Expected Actual Comm
Id Data t
Output output ent
Locks Stock Barrel a
s s t
u
s
21
Input Expected Actual
Case Data Output output
Description Id To To To Sa Com S
Sales Commission Comm
tal tal tal l m t
ent
Lo Sto Bar e iss a
cks cks rels io t
s n u
s
Enter the value for lock,
OR1 5 5 5 500 50
stocks and barrels where
0 < Sales < 1000
Enter the value for lock,
OR2 stocks and barrels where 15 15 15 1500 175
1000 < Sales < 1800
Enter the value for lock,
OR3 25 25 25 2500 360
stocks and barrels where
Sales < 1800
22
Experiment Number : 7
23
Precondition : Initial Value Total Locks= 0 , Total Stocks=0 and Total Barrels=0
Precondition Limit :Total locks, stocks and barrels should not exceed the limit 70,80 and 90 respectively
Commission Problem -Decision Table Test cases for input data
Ca Input Act St Co
Description Data Expected Output
se ual a m
L S Bar
I o t r
Out t m
d c o els put u ent
k c s s
s k
s
Terminate the input loop check for sales
1 Enter the value of Locks= -1
if(sales=0) exit from program else
-1
calculate commission
Total of locks,stocks is updated if it is with
Enter the valid input for
2 20 30 -5 in a precondition limit and Should display
lock and stack and
value of barrels is not
invalid for barrels
in the range 1..90
Total of locks, barrels is updated if it is with
Enter the valid input for
3 15 -2 45 in a precondition limit and Should display
lock and barrels and
value of barrels is not
invalid for stocks
in the range 1..80
Total of stocks , barrels is updated if it is
Enter the valid input for
4 -4 15 16 with in a precondition limit and Should
lock and barrels and
display value of barrels is not
invalid for stocks
in the range 1..70
Total of locks is updated if it is with in a
Enter the valid input
precondition limit and (i)Should display value
5 for lock and invalid 15 80 100
of stock is not in the range
value for stocks and
1..80 (ii)Should display value of barrels is not
barrels
in the range 1..90
Total of stocks is updated if it is with in a
Enter the valid input
precondition limit and (i)Should display
6 for stocks and invalid 88 20 99
value of lock is not in the range
value for locks and
1..70 (ii)Should display value of barrels is not
barrels
in the range 1..90
Total of barrels is updated if it is with in a
Enter the valid input
20 precondition limit and (i)Should display
7 for barrels and invalid 100 25
0 value of lock is not in the range
value for locks and
1..70 (ii)Should display value of stocks is not
stocks
in the range 1..80
(i) Should display value of lock is not in the
Enter the invalid input for 40
8 -5 -9 range 1..70
lock , stocks and barrels 0
(ii) Should display value of stocks is not in
the range 1..80
(iii) Should display value of barrel in not in
the range 1..90
Total of locks,stocks and barrels is updated if
Enter the valid input for
9 15 20 25 it is with in a precondition limit and calculate
lock, stocks and barrels
the sales and proceed to commission
24
Commission Problem -Decision Table Test cases for commission calculation
25
Program 8(Binary Search - Path Testing)
/* Design, develop a code and run the program in any suitable language to implement the binary
search algorithm. Determine the basis paths and using them derive different test cases execute
these test cases and discuss the test results */
#include <stdio.h>
int main()
{
int a[20], key, i, n, succ;
printf("Enter the n value: ");
scanf("%d", &n);
if (n > 0)
{
printf("Enter the elements in ascending order:\n");
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
26
Binary Search function with line number
int binsrc(int x[],int low, int high, int key)
{
int mid; 1
while(low<=high) 2
{
mid=(low+high)/2;
if(x[mid]==key) 3
return mid; 8
if(x[mid]<key) 4
low=mid+1; 5
else
high=mid-1; 6
} 7
return -1; 8
} 9
27
Test Cases – Binary Search
28
Program 9(Quick Sort-Path Testing)
/*Design, develop ,code and run the program in any suitable language to implement the
quicksort algorithm. Determine the basis paths and using them derive different test cases,
execute these test cases and discuss the test results.*/
#include <stdio.h>
while (i < j)
{
while (x[i] <= x[pivot] && i < last)
i++;
while (x[j] > x[pivot])
j--;
if (i < j)
{
temp = x[i];
x[i] = x[j];
x[j] = temp;
}
}
temp = x[pivot];
x[pivot] = x[j];
x[j] = temp;
// main program
int main()
{
int i, x[10];
printf("Enter the size of the array: ");
int n;
scanf("%d", &n);
29
printf("Enter the elements of the array:\n");
for (i = 0; i < n; i++)
scanf("%d", &x[i]);
quicksort(x, 0, n - 1);
30
Program Graph Quick Sort
31
Program 10 (Absolute Letter Grading Path Testing)
/* Design, develop, code and run the program in any suitable language to implement an absolute
letter grading procedure, making suitable assumptions. Determine the basis paths and using them
derive different test cases, execute these test cases and discuss the test results */
#include<stdio.h>
int main()
{
float per;
char grade;
scanf("%f",&per);
if(per>=90)
grade= 'A';
else if(per>=80 && per<90)
grade ='B';
else if(per>=70 && per<80)
grade ='C';
else if(per>=60 && per<70)
grade='D';
else grade='E';
switch(grade)
{
case 'A': printf("\nEXCELLENT"); break;
case 'B':printf("\nVery Good"); break;
case 'C' : printf("\nGood"); break;
case 'D': printf("\nAbove Average"); break;
case 'E': printf("\n Satisfactory"); break;
}
printf("\t The percentage = %f and grade is %c ",per,grade);
return 0;
}
32
Absolute Grading Program with Line Numbers and Program Graph
int main() Start
1
{
float per;
char grade; 2
1. scanf("%f",&per);
2. if(per>=90) 3
3. grade= 'A'; 4
4. else if(per>=80 && per<90)
5. grade ='B'; 5
6.
else if(per>=70 && per<80)
6
7. grade ='C';
8.
else if(per>=60 && per<70) 7
8
9. grade='D';
10. else grade='E'; 9
11. switch(grade) 10
12. {
13. case 'A': printf("\nEXCELLENT"); break;
14. case 'B':printf("\nVery Good"); break; 11
15. case 'C' : printf("\nGood"); break;
16. case 'D': printf("\nAbove Average"); break;
17. case 'E': printf("\n Satisfactory"); break; 13 14 15 16 17
18. }
19. printf("\t The percentage = %f and grade is %c ",per,grade);
20. return 0; 19
}
1 End
Independent Paths:
#Edges=25, #Nodes=18, #P=1
V(G)= E-N+2P = 25-18+2 = 09
33
Pre-Conditions/Issues:
Percentage Per is a positive Float Number
34
Program 11 and 12 ( Next date program)
/* Design,develop,code and run the program in any suitable language to implement the
NextDate function. Analyze it from the perspective boundary value testing and
equivalence class analysis. Derive different test cases, execute these test cases and
discuss the test results. */
#include<stdio.h>
int main()
{
int day,month,year,tomm_day,tomm_month,tomm_year;
char flag;
do
{
flag='y';
printf("\nenter the today's date in the form of dd mm yyyy\n");
scanf("%d%d%d",&day,&month,&year);
tomm_month=month;
tomm_year=year;
if(day<1 || day>31)
{
printf("value of day, not in the range 1...31\n");
flag='n';
}
if(month<1 || month>12)
{
35
printf("value of month, not in the range 1....12\n");
flag='n';
}
else if(check(day,month))
{
printf("value of day, not in the range day<=30");
flag='n';
}
if(year<=1812 || year>2013)
{
printf("value of year, not in the range 1812.......2013\n");
flag='n';
}
if(month==2)
{
if(isleap(year) && day>29)
{
printf("invalid date input for leap year");
flag='n';
}
else if(!(isleap(year)) && day>28)
{
printf("invalid date input for not a leap year");
flag='n';
}
}
}while(flag=='n');
switch (month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
if(day<31)
tomm_day=day+1;
else
{
tomm_day=1;
tomm_month=month+1;
}
break;
36
case 4:
case 6:
case 9:
case 11:
if(day<30)
tomm_day=day+1;
else
{
tomm_day=1;
tomm_month=month+1;
}
break;
case 12:
if(day<31)
tomm_day=day+1;
else
{
tomm_day=1;
tomm_month=1;
if(year==2013)
{
printf("the next day is out of boundary value of year\n");
tomm_year=year+1;
}
else
tomm_year=year+1;
}
break;
case 2:
if(day<28)
tomm_day=day+1;
else if(isleap(year) && day==28)
tomm_day=day+1;
else if(day==28 || day==29)
{
tomm_day=1;
tomm_month=3;
}
break;
}
37
Experiment Number : 11
Test Case Name : Boundary Value Analysis test cases for Next date program
Test data : Enter the three integer value
Pre-condition : Month 1 to 12 , DAY 1 TO 31 AND YEAR 1812 TO 2013 / we are consider one
corner of the input space
Min Max
Brief Description : Min +1 Normal -1 Max
Month 1 2 6 11 12
Day 1 2 15 30 31
Year 1812 1813 1912 2012 2013
38
Enter the min+1 value for
8 day , normal value for year 1 2 1912 1 3 1912
and min value for month
Enter the min+1 value for
9 day , max -1 value for year 1 2 2012 1 3 2012
and min value for month
Enter the min+1 value for
10 day , max value for year and 1 2 2013 1 3 2013
min value for month
Enter the normal value of
11 day and min for year and 1 15 1812 1 16 1812
month
Enter the normal value for
12 day and min+1 for year and 1 15 1813 1 16 1813
min for month
Enter the normal value for
13 day normal value for year and 1 15 1912 1 16 1912
min value for month
Enter the normal value for
14 day , max -1 value for year 1 15 2012 1 16 2012
and min value for month
Enter the normal value for
15 day , max value for year and 1 15 2013 1 16 2013
min value for month
Enter the max - 1 value of
16 day and min for day and 1 30 1812 1 31 1812
year
Enter the max -1 value for
17 day and min for month and 1 30 1813 1 31 1813
min+1 for year
Enter the max - 1 value for
18 day , normal value for year 1 30 1912 1 31 1912
and min value for month
Enter the max - 1 value for
19 day , max -1 1 30 2012 1 31 2012
value for year and min value
for month
Enter the max -1 value for
20 day , max value for year and 1 30 2013 1 31 2013
min value for month
39
Enter the max value of day
21
and min for year and month 1 31 1812 2 1 181
2
Enter the max value for day
22 and min for month and min + 1 31 1813 2 1 181
1 for year 3
Enter the max value for day ,
normal value for year and min 1 31 1912 2 1 191
value for month 2
Enter the max value for
24 day , max -1 value for year 1 31 2012 2 1 201
and min value for month 2
Enter the max value for
25 day , max value for year 1 31 2013 2 1 201
and min value for month 3
40
Experiment Number: 12
Test Case Name : Equivalence class test for Next Date program
Test data : Enter the three integer value
Pre-condition : Month 1 to 12 , DAY 1 TO 31 AND YEAR 1812 TO 2013
Valid Cases
M1 = { month ; 1 ≤ month ≤ 12 }
D1 = { day : 1 ≤ day ≤ 31 }
Y1 = { year : 1812 ≤ year ≤ 2013 }
Invalid cases
M2 = {month : month < 1}
M3 = {month : month > 12}
D2 = {day : day < 1}
D3 = {day : day > 31}
Y2 = {year : year < 1812}
Y3 = {year : year > 2013}
41
( Weak Robustness Equivalence Class )
Comme
Input Expected Actual Stat
nt
Case Description Data Output output us
Id mon
mont day year month day year da yea
th
h y r
WR1 6 15 1912 6 16 1912
Enter the M1, D1 and Y1
cases
Should display the
message value of the
WR2 Enter the M2 , D1 and -1 15 1912 month not in the range
Y1 cases 1..12
Should display the
message value of the
WR3 Enter the M3 ,D1 and Y1 13 15 1912 month not in the range
cases 1..12
Should display the
WR4 Enter the M1, D2 and Y1 6 -1 1912 message value of the
cases day not in the range
1..31
Should display the
WR5 Enter the M1, D3 and Y1 6 32 1912 message value of the
cases day not in the range
1..31
Should display the
message value of the
WR6 Enter the M1, D1 and Y2 6 15 1811 year not in the range
cases 1812..2013
Should display the
message value
WR7 Enter the M1, D1 and Y3 6 15 2014 of the year not in the
cases range 1812..2013
42
(Strong Robustness Equivalence Class )
Ca Input Co
Description Data Expected Output Actual Stat
s m
mont day year output us
e me
h nt
I
d
Should display the message
SR1 Enter the M2 , D1 and -1 15 191
value of the month not
Y1 cases 2
in the range 1..12
Should display the message
SR2 Enter the M1, D2 and Y1 6 -1 191
value of the day not in
cases 2
the range 1..31
Should display the message
SR3 Enter the M1, D1 and Y2 6 15 181
value of the year not in
cases 1
the range 1812..2013
(i)Should display the message
value of the month
SR4 Enter the M2 , D2 and -1 -1 191
in range 1..12
Y1 cases 2
(ii) Should display the
message value of
the day in range
1..31
(i) Should display the
message value of
SR5 Enter the M1, D2 and 6 -1 181 the day in range
Y2 cases 1 1..31
(ii) Should display the
message value of the
year in range
1812..2013
(i)Should display the message
value of the month
SR6 Enter the M2, D1 and -1 15 181
in range 1..12
Y2 cases 1
(ii) Should display the
message value of the
year in range
1812..2013
(i)Should display the message
value of the month
in range 1..12
43
SR7 Enter the M2, D2 and -1 -1 181 (ii) Should display the
Y2 cases 1 message value of
the day in range
1..31
(iii) Should display the
message value of the
year in range
1812..2013
Case Id Description Input Data Expected Output Actual output Stat Commen
us t
day mo year day mont year day mo year
nth h nth
44