Vous êtes sur la page 1sur 18

Question 7: Admission to a professional course is subject to the following conditions:

a) Marks in Mathematics >=55


b) Marks in Physics >=50
c) Marks in Chemistry >=50
d) Total in all 3 Subjects >=200
OR
e) Total in Mathematics and Physics >=150
If the aggregate marks of a candidate are more than 250, he/she will be eligible for honors
course, otherwise he/she will be eligible for pass course. The program reads the marks in the
three subjects and generates the following outputs:
a) Not Eligible
b) Eligible for Pass Course
c) Eligible for Honors Course
Design Test Cases using Decision Table Testing Techniques.

Condition Stub

Decision Table

C1: Marks in Mathematics >=55


C2: Marks in Physics >=50

Condition Entry(Rules)
T
F
T
F

C3: Marks in Chemistry >=50

T
F

C4: Total in all 3 Subjects >=200


F

C5: Total in Mathematics and Physics >=150

T
T
F

Action Stub

C6: Total in all 3 Subjects >=250


Not Eligible

T
F

X
X

Eligible for Honors Course


X

Eligible for Pass Course


Impossible

X
Action entry

X
X

Test Cases for the decision table

Number of test cases: 9


Input Domain: Marks in mathematics, m1: [0-100]
Marks in physics, m2
: [0-100]
Marks in chemistry, m3 : [0-100]
Output Domain: O1: {<m1, m2, m3>: Invalid output}
O2: {<m1, m2, m3>: Not Eligible}
O3: {<m1, m2, m3>: Eligible for honors course}
O4: {<m1, m2, m3>: Eligible for pass course}
O5: {<m1, m2, m3>: Impossible}
Test Cases
Test
Case
id
1
2
3
4
5
6
7
8
9

Input
Actual Output
m2
m3
(Phys (Chemi
ics)
stry)

Expected output

Result

m1
(Mathe
matics
40
58
85
60
75
75
70
75
85

80
35
88
60
75
70
70
75
85

Not Eligible
Not Eligible
Not Eligible
Not Eligible
Impossible, I1
Eligible for Pass Course
Impossible, I2
Eligible for Pass Course
Eligible for Honors Course

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

85
78
33
60
50
80
100
75
80

Not Eligible
Not Eligible
Not Eligible
Not Eligible
Impossible, I1
Eligible for Pass Course
Impossible, I2
Eligible for Pass Course
Eligible for Honors Course

I1: If C3 (Marks in Chemistry >=50) and C5 (Total in Mathematics and Physics >=150) are true,
then C4 (Total in all 3 Subjects >=200) has to be true, cant be false. Hence impossible
I2: If C5 (Total in Mathematics and Physics >=150) is false, then even 100 marks in chemistry
cant make the C6 (Total in all 3 Subjects >=250) true. Hence impossible

Question 8: Consider a program below for the selection of the largest of numbers.
import java.util.Scanner;
public class greater
{public static void main(String args[])
{Scanner object = new Scanner(System.in);
int a,b,c;
System.out.print("\nEnter First Number,a: ");
a = object.nextInt();
System.out.print("\nEnter Second Number,b: ");
b = object.nextInt();
System.out.print("\nEnter Third Number,c: ");
c = object.nextInt();
if(a<10 || a>250 || b<10 || b>250 || c<10 || c>250)
System.out.print("\nInvalid Input");
else
{System.out.print("\nLargest Value is: ");
if(a>b)
{if (a>c)
System.out.print(a);
else
System.out.print(c);
}
else
{if (c>b)
System.out.print(c);
else
System.out.print(b);
}
}
}// end of main function
}// end of class greater
i)
ii)
iii)

Design set of test cases using boundary value analysis technique and equivalence
class testing technique. The input may be any valid integer in the range [10-250].
Select a set of test cases that provide 100% statement coverage.
Develop a decision table for this program.

(i)

Boundary Value Analysis (BVA)

Number of Inputs, n: 3 (a, b, c)


Number of Test Cases: 4(n) + 1
= 4(3) + 1
= 13
Input Domains: a: - [10-250]
b: - [10-250]
c: - [10-250]
Number of Values in Output Domain: 2
Output Domains: O1: {<a,b,c> : Invalid Input}
O2: {<a,b,c> : Largest Value}

Boundary Test Case Table

Test Case Id
1
2
3
4
5
6
7
8
9
10
11
12
13

Input
A
130
130
130
130
130
130
130
130
130
10
11
249
250

B
130
130
130
130
130
10
11
249
250
130
130
130
130

C
10
11
130
249
250
130
130
130
130
130
130
130
130

Expected Output

Actual Output

Result

Largest Value is: 130


Largest Value is: 130
Largest Value is: 130
Largest Value is: 249
Largest Value is: 250
Largest Value is: 130
Largest Value is: 130
Largest Value is: 249
Largest Value is: 250
Largest Value is: 130
Largest Value is: 130
Largest Value is: 249
Largest Value is: 250

Largest Value is: 130


Largest Value is: 130
Largest Value is: 130
Largest Value is: 249
Largest Value is: 250
Largest Value is: 130
Largest Value is: 130
Largest Value is: 249
Largest Value is: 250
Largest Value is: 130
Largest Value is: 130
Largest Value is: 249
Largest Value is: 250

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Equivalence Class Test


Number of Inputs, n: 3 (a,b,c)
Input Domains: a: - [10-250]
b: - [10-250]
c: - [10-250]
Number of Test Cases: 9
Test Cases: I1: {<a,b,c>: a<10}
I2: {< a,b,c >: 10 <= a <= 250}
I3: {< a,b,c >: a > 250}
I4: {<a,b,c>: a<10}
I5: {< a,b,c >: 10 <= a <= 250}
I6: {< a,b,c >: a > 250}
I7: {<a,b,c>: a<10}
I8: {< a,b,c >: 10 <= a <= 250}
I9: {< a,b,c >: a > 250}
Number of Values in Output Domain: 4
Output Domain: O1: {<a,b,c>: Invalid Input}
O2: {<a,b,c>: Largest Value is a}
O3: {<a,b,c>: Largest Value is b}
O4: {<a,b,c>: Largest Value is c}

Equivalence Class Test Case Table


Test Case
Id
I1
I2
I3
I4
I5
I6
I7
I8
I9

a
0
200
500
225
225
225
225
225
225

Input
b
225
225
225
0
200
500
225
225
225

c
225
225
225
225
225
225
0
200
500

Expected Output

Actual Output

Result

Invalid Input
Largest Value is: 225
Invalid Input
Invalid Input
Largest Value is: 225
Invalid Input
Invalid Input
Largest Value is: 225
Invalid Input

Invalid Input
Largest Value is: 225
Invalid Input
Invalid Input
Largest Value is: 225
Invalid Input
Invalid Input
Largest Value is: 225
Invalid Input

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

ii)

Select a set of test cases that provide 100% statement coverage.

Number of Inputs, n: 3 (a, b, c)


Input Domains: a: - [10-250]
b: - [10-250]
c: - [10-250]
Number of Test Cases: 4 [each supporting one output domain]
Number of Values in Output Domain: 4
Output Domains: O1: {<a,b,c>: Invalid Input}
O2: {<a,b,c> : Largest Value is: a}
O3: {<a,b,c> : Largest Value is: b}
O4: {<a,b,c> : Largest Value is: c}

Test Case Id
1
2
3
4

Input
A
0
249
130
130

B
130
130
250
130

C
130
130
130
249

Expected Output

Actual Output

Result

Invalid Input
Largest Value is: 249
Largest Value is: 250
Largest Value is: 249

Invalid Input
Largest Value is: 249
Largest Value is: 250
Largest Value is: 249

Nil
Nil
Nil

Decision Table Test

Condition
Stub

(iii)

Decision Table Test Cases


Condition Entry (Rules)
F
T

C1: a>b

C2: a>c
F

C3: c>b

T
T

F
T

T
T

Action
Stub

Largest value is a
Largest value is b
Largest value is c

X
X

X
X

Impossible

Action Entry
Test Cases for the decision table
Number of test cases: 8
Input Domains: a: - [10-250]
b: - [10-250]
c: - [10-250]
Number of Values in Output Domain: 4
Output Domains: O1: {<a,b,c>: Invalid Input}
O2: {<a,b,c> : Largest Value is: a}
O3: {<a,b,c> : Largest Value is: b}
O4: {<a,b,c> : Largest Value is: c}
O4: {<a,b,c> : Impossible}
Test Cases
Test
Input
Actual Output
Case a
b
c
id
1
65 75
70
Largest Value is: 75
2
50 80
100 Largest Value is:100
3
150 220 120 Largest Value is:220
4
100 225 75
Impossible, I1
5
240 200 250 Impossible, I2
6
225 200 250 Largest Value is:250
7
175 150 75
Largest Value is:175
8
229 148 159 Largest Value is:229

Expected output

Largest Value is: 75


Largest Value is:100
Largest Value is:220
Impossible, I1
Impossible I2
Largest Value is:250
Largest Value is:175
Largest Value is:229

Result

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

I1: If C2 (a>c) and C3 (c>b) are true, then C1 (a>b) is true, cant be false. Hence Impossible
I2: If C2 (a>c) and C3 (c>b) are false, then C1 (a>b) is false too, cant be true. Hence Impossible

Question 9: Write a program for determining the previous date. The input is a triple of day,
month and year with values in the range:
1 <= day <= 31
1<= month <=12
1900 <= year <= 2020
The possible output would be previous date or invalid input date. Design the Boundary value,
Robust and Worst cases for this program.

Code
import java.util.Scanner;
class previousdate
{public static void main(String args[])
{ Scanner object = new Scanner(System.in);
System.out.print("\nEnter the day:");
int day = object.nextInt();
System.out.print("\nEnter the month:");
int month = object.nextInt();
System.out.print("\nEnter the year:");
int year = object.nextInt();
if( (year>2020) || (year<1900) || (month<1) || (month>12) || (day<1) || (day>31) )
{System.out.println("\n\nInvalid Input");
return;
}
int daysallowed;
if( month==1 || month==3 || month==5 || month== 7 || month==8 || month==10 || month==12)
daysallowed = 31;
else if( month==4 || month==6 || month==9 || month== 11)
daysallowed = 30;
else
{ boolean isLeapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));
if(isLeapYear == true)
daysallowed = 29;
else
daysallowed = 28;
}

if(day > daysallowed )


{System.out.println("\n\nInvalid Input");
return;
}
else
{ if(day>1)
System.out.println("\n\nPrevious Date: " + (day-1) + "/" + month + "/" + year);
else if(month>1)
{ if( month-1==1 || month-1==3 || month-1==5 || month-1== 7 || month-1==8 ||
month-1==10 || month-1==12 )
daysallowed = 31;
else if( month-1==4 || month-1==6 || month-1==9 || month-1== 11)
daysallowed = 30;
else // belongs to upper chain of if-elses
{ boolean isLeapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));
if(isLeapYear == true)
daysallowed = 29;
else // belongs to if(isLeapYear == true)
daysallowed = 28;
}
System.out.println("\n\nPrevious Date: " + daysallowed + "/" + (month-1) + "/" +
year);
}// end of else if(month>1)
else
System.out.println("\nPrevious Date: 31/12/" + (year-1) );
// if entered date is 1st of January, them previous date must be 31st December of
// previous year
}
} // end of main method
}// end of class

Boundary Value Analysis (BVA)


Number of Inputs, n: 3 (day, month, year)
Input Domains: day: - [1-31]
month: - [1-12]
year: - [1900-2020]
Output Domain: O1: {<day,month,year> : Previous date}
O2: {<day,month,year> : Invalid Input}
Number of Test Cases: 4(n) + 1
= 4(3) + 1
= 13

Boundary Test Case Table

Test
Case
Id
1
2
3
4
5
6
7
8
9
10
11
12
13

Input
day month year
16
16
16
16
16
16
16
16
16
1
2
30
31

6
6
6
6
6
1
2
11
12
6
6
6
6

1900
1901
1960
2019
2020
1960
1960
1960
1960
1960
1960
1960
1960

Expected Output

15/6/1900
15/6/1901
15/6/1960
15/6/2019
15/6/2020
15/6/1960
15/6/1960
15/11/1960
15/12/1960
31/5/1960
1/6/1960
29/6/1960
30/6/1960

Actual Output

16/6/1900
15/6/1901
15/6/1960
15/6/2019
15/6/2020
15/6/1960
15/6/1960
15/6/1960
15/12/1960
31/5/1960
1/6/1960
29/6/1960
30/6/1960

Result

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Robustness
Number of Inputs, n: 3 (day, month, year)
Input Domains: day: - [1-31]
month: - [1-12]
year: - [1900-2020]
Number of Test Cases: 6(n) + 1
= 6(3) + 1
= 19
Output Domain: O1: {<day,month,year> : previous date}
O2: {<day,month,year> : Invalid Input}

Robustness Test Cases Table


Test
Case
Id
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Input
day
0
1
2
16
30
31
32
16
16
16
16
16
16
16
16
16
16
16
16

month
6
6
6
6
6
6
6
0
1
2
11
12
13
6
6
6
6
6
6

year
1960
1960
1960
1960
1960
1960
1960
1960
1960
1960
1960
1960
1960
1899
1900
1901
2019
2020
2021

Expected Output

Actual Output

Result

Invalid Input
31/5/1960
1/6/1960
15/6/1960
29/6/1960
30/6/1960
Invalid Input
Invalid Input
15/1/1960
15/2/1960
15/11/1960
15/12/1960
Invalid Input
Invalid Input
15/5/1900
15/5/1901
15/5/2019
15/5/2020
Invalid Input

Invalid Input
31/5/1960
1/6/1960
15/6/1960
29/6/1960
30/6/1960
Invalid Input
Invalid Input
15/1/1960
15/2/1960
15/11/1960
15/12/1960
Invalid Input
Invalid Input
15/5/1900
15/5/1901
15/5/2019
15/5/2020
Invalid Input

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Worst Case Testing


Number of Inputs, n: 3 (day, month, year)
Input Domains: day: - [1-31]
month: - [1-12]
year: - [1950-2020]
Output Domain: O1: {<day,month,year> : previous date}
O2: {<day,month,year> : Invalid Input}
Number of Test Cases: 5n = 53 = 125
Worst Test Cases Table
Test
Case Id
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Input
day
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Expected Output Actual Output Result


month
1
1
1
1
1
2
2
2
2
2
6
6
6
6
6
11
11
11
11
11
12
12

year
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901

31/12/1899
31/12/1900
31/12/1959
31/12/2018
31/12/2019
31/1/1900
31/1/1901
31/1/1960
31/1/2019
31/1/2020
31/5/1900
31/5/1901
31/5/1960
31/5/2019
31/5/2020
31/10/1900
31/10/1901
31/10/1960
31/10/2019
31/10/2020
30/11/1900
30/11/1901

31/12/1899
31/12/1900
31/12/1959
31/12/2018
31/12/2019
31/1/1900
31/1/1901
31/1/1960
31/1/2019
31/1/2020
31/5/1900
31/5/1901
31/5/1960
31/5/2019
31/5/2020
31/10/1900
31/10/1901
31/10/1960
31/10/2019
31/10/2020
30/11/1900
30/11/1901

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Test
Case Id
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

Input
day month
1
12
1
12
1
12
2
1
2
1
2
1
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
6
2
6
2
6
2
6
2
6
2
11
2
11
2
11
2
11
2
11
2
12
2
12
2
12
2
12
2
12
6
1
6
1
6
1
6
1
6
1
6
2
6
2
6
2
6
2

Expected Output Actual Output Result


year
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019

30/11/1960
30/11/2019
30/11/2020
1/1/1900
1/1/1901
1/1/1960
1/1/2019
1/1/2020
1/2/1900
1/2/1901
1/2/1960
1/2/2019
1/2/2020
1/6/1900
1/6/1901
1/6/1960
1/6/2019
1/6/2020
1/11/1900
1/11/1901
1/11/1960
1/11/2019
1/11/2020
1/12/1900
1/12/1901
1/12/1960
1/12/2019
1/12/2020
5/1/1900
5/1/1901
5/1/1960
5/1/2019
5/1/2020
5/2/1900
5/2/1901
5/2/1960
5/2/2019

30/11/1960
30/11/2019
30/11/2020
1/1/1900
1/1/1901
1/1/1960
1/1/2019
1/1/2020
1/2/1900
1/2/1901
1/2/1960
1/2/2019
1/2/2020
1/6/1900
1/6/1901
1/6/1960
1/6/2019
1/6/2020
1/11/1900
1/11/1901
1/11/1960
1/11/2019
1/11/2020
1/12/1900
1/12/1901
1/12/1960
1/12/2019
1/12/2020
5/1/1900
5/1/1901
5/1/1960
5/1/2019
5/1/2020
5/2/1900
5/2/1901
5/2/1960
5/2/2019

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Test
Case Id
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

Input
day month
6
2
6
6
6
6
6
6
6
6
6
6
6
11
6
11
6
11
6
11
6
11
6
12
6
12
6
12
6
12
6
12
30
1
30
1
30
1
30
1
30
1
30
2
30
2
30
2
30
2
30
2
30
6
30
6
30
6
30
6
30
6
30
11
30
11
30
11
30
11
30
11
30
12

Expected Output Actual Output Result


year
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900

5/2/2020
5/6/1900
5/6/1901
5/6/1960
5/6/2019
5/6/2020
5/11/1900
5/11/1901
5/11/1960
5/11/2019
5/11/2020
5/12/1900
5/12/1901
5/12/1960
5/12/2019
5/12/2020
29/1/1900
29/1/1901
29/1/1960
29/1/2019
29/1/2020
29/2/1900
29/2/1901
29/2/1960
29/2/2019
29/2/2020
29/6/1900
29/6/1901
29/6/1960
29/6/2019
29/6/2020
29/11/1900
29/11/1901
29/11/1960
29/11/2019
29/11/2020
29/12/1900

5/2/2020
5/6/1900
5/6/1901
5/6/1960
5/6/2019
5/6/2020
5/11/1900
5/11/1901
5/11/1960
5/11/2019
5/11/2020
5/12/1900
5/12/1901
5/12/1960
5/12/2019
5/12/2020
29/1/1900
29/1/1901
29/1/1960
29/1/2019
29/1/2020
29/2/1900
29/2/1901
29/2/1960
29/2/2019
29/2/2020
29/6/1900
29/6/1901
29/6/1960
29/6/2019
29/6/2020
29/11/1900
29/11/1901
29/11/1960
29/11/2019
29/11/2020
29/12/1900

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Test
Case Id
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

Input
day month
30
12
30
12
30
12
30
12
31
1
31
1
31
1
31
1
31
1
31
2
31
2
31
2
31
2
31
2
31
6
31
6
31
6
31
6
31
6
31
11
31
11
31
11
31
11
31
11
31
12
31
12
31
12
31
12
31
12

Expected Output Actual Output Result


year
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020
1900
1901
1960
2019
2020

29/12/1901
29/12/1960
29/12/2019
29/12/2020
30/1/1900
30/1/1901
30/1/1960
30/1/2019
30/1/2020
30/2/1900
30/2/1901
30/2/1960
30/2/2019
30/2/2020
30/6/1900
30/6/1901
30/6/1960
30/6/2019
30/6/2020
30/11/1900
30/11/1901
30/11/1960
30/11/2019
30/11/2020
30/12/1900
30/12/1901
30/12/1960
30/12/2019
30/12/2020

29/12/1901
29/12/1960
29/12/2019
29/12/2020
30/1/1900
30/1/1901
30/1/1960
30/1/2019
30/1/2020
30/2/1900
30/2/1901
30/2/1960
30/2/2019
30/2/2020
30/6/1900
30/6/1901
30/6/1960
30/6/2019
30/6/2020
30/11/1900
30/11/1901
30/11/1960
30/11/2019
30/11/2020
30/12/1900
30/12/1901
30/12/1960
30/12/2019
30/12/2020

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

Question 10: Write a program for grading the students in an academic institution. The grading is
done according to the following rules:
Marks Obtained
80-100
60-79
50-59
40-49
0-39

Grade
Distinction
First Division
Second Division
Third Division
Fail

Generate test cases using Equivalence class testing technique.


Code
import java.util.Scanner;
class grade
{ public static void main(String args[])
{ Scanner object = new Scanner(System.in);
int marks=0;
for(int i=0;i<5;i++)
{System.out.print("\nEnter the marks for subject " + (i+1) + ": ");
marks += object.nextInt();
}
marks/=5;
if(marks<0 || marks>100)
System.out.println("Invalid Input");
else if(marks<=100 && marks>=80)
System.out.println("Distinction");
else if(marks<=79 && marks>=60)
System.out.println("First Division");
else if(marks<=59 && marks>=50)
System.out.println("Second Division");
else if(marks<=49 && marks>=40)
System.out.println("Third Division");
else if(marks<=39 && marks>=0)
System.out.println("Fail");
}
}

Equivalence Class Test


Number of Inputs, n: 5 (marks[0],marks[1],marks[2],marks[3],marks[4])
Input Domains: marks[0] : - [0-100]
marks[1] : - [0-100]
marks[2] : - [0-100]
marks[3] : - [0-100]
marks[4] : - [0-100]
Number of Test Cases: 15
Test Cases: I1: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[0]<0}
I2: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: 0<=marks[0]<=100}
I3: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[0]>100}
I4: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[1]<0}
I5: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: 0<=marks[1]<=100}
I6: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[1]>100}
I7: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[2]<0}
I8: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: 0<=marks[2]<=100}
I9: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[2]>100}
I10: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[3]<0}
I11: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: 0<=marks[3]<=100}
I12: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[3]>100}
I13: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[4]<0}
I14: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: 0<=marks[4]<=100}
I15: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: marks[4]>100}
Number of Values in Output Domain: 6
Output Domain: O1: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: Invalid Input}
O2: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: Distinction}
O3: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: First Division}
O4: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: Second Division}
O5: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: Third Division}
O6: {< marks[0], marks[1], marks[2], marks[3], marks[4]>: Fail}

Equivalence Class Test Case Table


Test
Case
Id
I1
I2
I3
I4
I5
I6
I7
I8
I9
I10
I11
I12
I13
I14
I15

Input
Expected
marks[0] marks[1] marks[2] marks[3] marks[4] Output

Actual Output

Result

-1
50
101
50
90
50
50
40
50
50
65
50
50
25
50

Invalid Input
Second Division
Invalid Input
Invalid Input
Distinction
Invalid Input
Invalid Input
Third Division
Invalid Input
Invalid Input
First Division
Invalid Input
Invalid Input
Fail
Invalid Input

Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil
Nil

50
50
50
-1
90
101
50
40
50
50
65
50
50
25
50

50
50
50
50
90
50
-1
40
101
50
65
50
50
25
50

50
50
50
50
90
50
50
40
50
-1
65
101
50
25
50

50
50
50
50
90
50
50
40
50
50
65
50
-1
25
101

Invalid Input
Second Division
Invalid Input
Invalid Input
Distinction
Invalid Input
Invalid Input
Third Division
Invalid Input
Invalid Input
First Division
Invalid Input
Invalid Input
Fail
Invalid Input

Vous aimerez peut-être aussi