[Exercise 1]Boundary value analysis technique 1/ value analy value analysis technique 1/sis technique 1/ 2 Suppose y value analysis technique 1/ou are testing a program that a prog a p
Trang 1(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui 1
Software Testing – Practice
(Answer)
[1] Black Box Testing Techniques
Trang 2[Exercise 1]
Boundary value analysis technique (1/ value analy value analysis technique (1/sis technique (1/ 2)
Suppose y value analysis technique (1/ou are testing a program that a prog a program that ram that that
calculates the cost of a hotel stay a hotel stay value analysis technique (1/ The co The co
ay value analysis technique (1/s stay value analysis technique (1/ed and the room that rate The co The room that
rate is determ that ined by value analysis technique (1/ the ty value analysis technique (1/pe of a hotel stay room that (s
ing a program that le or double) and the season (hig a program that h or l
wing a program that f a hotel stayorm that ula:
cost = number of days * room rate num that ber of a hotel stay day value analysis technique (1/s * room rate room that rate
Trang 3 Sing a program that le room that : $50 per night per nig a program that ht in the low seaso
n , and and $10 per night 0 per night per nig a program that ht in the hig a program that h season The co
Double room that : $75 per nig a program that ht in the low seaso
n , and and $150 per night per nig a program that ht in the hig a program that h season The co
Using a program that the boundary value analysis technique (1/ value analy value analysis technique (1/sis techni
que , and identif a hotel stayy value analysis technique (1/ the test cases that would b
e the m that ost effective in testing a program that this prog a program that r
am that The co
[Exercise 1]
Boundary value analysis technique (1/ value analy value analysis technique (1/sis technique (2/ 2)
(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
Trang 4 First, and we need to identif a hotel stayy value analysis technique (1/ the boundaries
of a hotel stay the input rang a program that es
Num that ber of a hotel stay day value analysis technique (1/s stay value analysis technique (1/ed: Min: 1, and Max: Non
e The co
Room that ty value analysis technique (1/pe: Sing a program that le, and Double The co
Season: Low, and Hig a program that h The co
Because the rang a program that e ty value analysis technique (1/pes of a hotel stay the inputs ar
e not the sam that e, and so we can have several a ccepted answers The co
Exercise 1 – Answer (1/3)
Trang 55 (C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
Exercise 1 – Answer (2/3)
Trang 6Exercise 1 – Answer (3/3)
file)
Trang 7 In f a hotel stayact, and we have m that any value analysis technique (1/ ty value analysis technique (1/pes of a hotel stay Boundary value analysis technique (1/ v
alue analy value analysis technique (1/sis techniques:
Standard BVA: Maxim that um that num that ber of a hotel stay test cases:
4n+1
Robustness: Maxim that um that num that ber of a hotel stay test cases: 6
n+1
Worst-case: Maxim that um that num that ber test cases: 5 n
Robust worst-case: Maxim that um that num that ber of a hotel stay test c
d on 5 VALID values :[m that in, and m that in+, and nom that inal, and
m that ax-, and m that ax]
(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
BUT WHY? (1/4)
Note: n is the number of variables.
Trang 8 Why value analysis technique (1/ is 4n + 1?
on 5 VALID values :[m that in, and m that in+, and nom that inal, and
m that ax-, and m that ax]
Total test cases = number of days * room rate
(Num that ber of a hotel stay variables * room rate Num that ber of a hotel stay testing a program that p
oints without nom that inal ) + 1 (f a hotel stayor Nom that inal)
= number of days * room rate 4n + 1
BUT WHY? (2/4)
Trang 9 However, and in exercise 1, and the rang a program that e ty value analysis technique (1/pes o
f a hotel stay the inputs are not the sam that e:
Num that ber of a hotel stay day value analysis technique (1/s stay value analysis technique (1/ed: Min: 1, and Max: None
Room that ty value analysis technique (1/pe: Sing a program that le, and Double (No m that in/m that ax/nom that
inal)
Season: Low, and Hig a program that h (No m that in/m that ax/nom that inal)
(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
• Number of days stayed:
Boundary value analysis technique (1//Max values according a program that to
real-lif a hotel staye
• Room type/season: Loop
throug a program that h all or select several
values as long a program that as the num that ber of a hotel stay
test cases <= number of days * room rate MAXIMUM
BUT WHY? (3/4)
Ex1: In theory, 4n+1 = 4*3+1 = 13
Trang 10 Answer 2: Num that The co of a hotel stay test cases = number of days * room rate 12 < Max
= number of days * room rate 13
BUT WHY? (4/4)
Trang 11d Z The co
X: 0 per night 10 per night 0 per night The co
Y: 20 per night 60 per night The co
Z: 80 per night 10 per night 0 per night The co
f a hotel stayor this prog a program that ram that ?
(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
Example for Standard BVA (1/4)
Trang 12 First, and finding a program that the valid values f a hotel stayor each
variable
Example for Standard BVA (2/4)
Trang 13 Next
m that ake a com that bination with each value of a hotel stay Z
13 (C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
Example for Standard BVA (3/4)
Trang 14 Result
Example for Standard BVA (4/4)
Trang 15[Exercise 2]
Orthog a program that onal Array value analysis technique (1/
A – 2 values (A1, A2)
B – 3 values (B1, B2, B3)
C – 3 values (C1, C2, C3)
Using a program that the Orthog a program that onal Array value analysis technique (1/ Testing a program that
technique , and identif a hotel stayy value analysis technique (1/ the test cases f a hotel stayor this prog a program that ram that The co
(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui
Trang 16 3 variables:
A – 2 values (A1, A2)
B – 3 values (B1, B2, B3)
C – 3 values (C1, C2, C3)
Exercise 2 – Answer (1/2)
3 Factors & 3
Levels
Array value analysis technique (1/ Ty value analysis technique (1/pe L 9 (3 4 )
NOTE: L 4 (2 3 ) and L 8 (2 7 ) cannot be chosen because
they have only 2 possible values (levels)
Trang 17 Result
17
Empty Orthogonal Array cell Cycle values in
them.
Exercise 2 – Answer (2/2)
(C) 2023 – Pham Nhat Duy – Nguyen Ngoc Qui