CE/CS/SE 3354 Software Engineering Homework #5 – Testing 1. Given a black box de
ID: 3913854 • Letter: C
Question
CE/CS/SE 3354 Software Engineering
Homework #5 – Testing
1. Given a black box description of the inputs to a given program P1:
integer A in [-3, 105].
a) What are the equivalence classes for input A to P1?
b) Create a test set that will cover the equivalence classes for A in P1.
2. Based on boundary value analysis, what test cases should we use for the input
integer A in program P1?
3. Given a black box description of the inputs to a given program P2:
integer X in [0,10] or [20,30].
a) What are the equivalence classes for input X to P2?
b) Create a test set that will cover the equivalence classes for X in P2.
4. Based on boundary value analysis, what test cases should we use for the input
integer X in program P2?
Explanation / Answer
1)Given program P1;integer A in [-3,105]
a)Equivalent class partitioning is a black box technique
In this technique divide the input data of software into different equivalance data classes.
-3 105 | 106 150
valid | invalid
Take the input between the -3 to 105 is vaild case and take 111 as input that is invaild case.
b) Equivalence classes:
Invalid | Vaild | Invalid | Invalid
-4 | -3 105 | 106 150|151
partition 1 | partition 2 | partition 3 |partition 4
The divided sets are called Equivalence classes or Equivalence partitions.
Then we pick only one value from each partition for testing. If one condition in partition is pass then the partition is pass otherwise if one condition in partition fails then partition is fail.
2)Boundary Value Analysis:
In Boundary Value Analysis tast boundaries between the equivalence partitions.
Invalid | Vaild | Invalid | Invalid
-4 | -3 105 | 106 150|151
partition 1 | partition 2 | partition 3 |partition 4
one value of each partition will check the values at the partition like -4,-2,105,107,151....
As you may observe,test valyes at both valid and invalid boundaries.Boundary Value analsis is also called "Range checking".
3)Given program P2;integer x in [0,10]or[20,30]
a)Equivalent class partitioning is a black box technique
In this technique divide the input data of software into different equivalance data classes.
0 10 | 11 19|20 30|31
valid | invalid | valid | invalid
Take the input between the 0 to 10 or 20 to 30 is vaild case and take 11 as input that is invaild case 31 is also a invalid case.
b) Equivalence classes:
-1 |0 10 | 11 19| 20 30 | 31
Invalid | valid | invalid | valid | invalid
partition 1 | partition 2 | partition 3 | partition 4 | partion 5
The divided sets are called Equivalence classes or Equivalence partitions.
Then we pick only one value from each partition for testing. If one condition in partition is pass then the partition is pass otherwise if one condition in partition fails then partition is fail.
4)
In Boundary Value Analysis tast boundaries between the equivalence partitions.
-1 | 0 10 | 11 19 | 20 30 | 31
Invalid | valid | invalid | valid | invalid
partition 1 | partition 2 | partition 3 | partition 4 | partion 5
one value of each partition will check the values at the partition like -1,1,10,11,20,29,31....
As you may observe,test valyes at both valid and invalid boundaries.Boundary Value analsis is also called "Range checking".