if exhaustive testing is not possible, then
how many test cases? 12
what are the values? -129, -128, -127, 0, 9,10,11,65,126,127,128
test case design techniques:
with less test cases, find max possible errors.
equivalence class partitioning ==> boundary (relational operator)
boundary value analysis ==> boundary (relational operator)
MC/DC ==> logical equation && ||
Requirement based testing RBT:
REQ1: If a is greater than 10, then set b to True; otherwise False.
Note: a is integer type. Range (-128 to 127)
b is Boolean type. Range: True, False
REQ1: If a>10, then set b to TRUE; otherwise False, if a in within the range; otherwise display "invalid input" error message.
Note: a is integer type. Range (-128 to 127)
b is Boolean type. Range: True, False
inputs:
a (int)
outputs:
b (boolean)
error message (string)
test cases:
----------------------------------------------
a b error message
-129 n/a invalid input ==> invalid test case (robustness test case) pass
-128 false n/a ==> normal range test case pass
-127 false n/a pass
0 false n/a pass
9 false n/a pass
10 false n/a pass
11 true n/a pass
12 true n/a pass
69 true n/a pass
126 true n/a pass
127 true n/a pass
128 n/a invalid input ==> invalid test case (robustness test cases) pass
--------------------------------------------
equivalence class partitioning + boundary value analysis
---------------------------------------------
[-128 to 127]
[-128 to 10] [11 to 127]
false true
understand requirement. identify inputs and outputs variables. types and ranges
input: a (int ==> -128 to 127)
output: b (bool ==> True, False)
ECP: atleast one test case for each equivalence class (each behavior)
equivalence class - behavior same
[-128 to 10] ==> False ==> -129, -128, -127, 0, 9, 10, 11
[11 to 127] ==> True ==> 10,11,12, 65, 126,127,128
missed identifying errors at boundaries. we have use BVA along with ECP to catch errors at boundaries.
a exp b act b
10 False True FAIL
25 True True PASS
BVA ==> 7 test cases for each equivalence
[min, max]
min-1, min, min+1, mid, max-1, max, max+1
if(a>=10)
b = True;
else
b = False;