Download presentation
Presentation is loading. Please wait.
Published byLynn Francis Modified over 9 years ago
1
Software testing School of Software Engineering, HUST Wujianjie2000@sina.com 1
2
Chapter2 Black-box Testing Terms Special value testing ,特殊值测试 Random testing/ Ad hoc testing ,随机测试 Boundary value testing ,边界值测试 Test-to-pass ,通过测试 Test-to-fail ,失败测试 2
3
Chapter2 Black-box Testing Black-Box testing Input Output 3
4
Chapter2 Black-box Testing Test-to-pass When you test-to-pass, you really assure only that the software minimally works. When designing and running your test cases, always run the test-to-pass cases first. Test-to-fail Designing and running test cases with the sole purpose of breaking the software is called testing- to-fail or error-forcing The goal of testing-to-fail is to test the software if it have error tolerance. 4
5
5 Chapter2 Black-box Testing Boundary value testing Equivalence partitioning Scenario testing
6
1.1 Reason Large number of errors tend to occur at boundaries of the input domain. Boundary Value Testing leads to selection of test cases that exercise boundary values. 6
7
1.1 Reason It complements equivalence partitioning. Rather than select any element in an equivalence class, select those at the “ edge ” of the class. 7
8
1.2 Questions Where is the boundary? How to define neighbors of the boundary? How to choose test data on the boundary? How to design test cases according to the test data? 8
9
1.2 Questions (1)Where is the boundary? a b c d x 2 x 1 9
10
1.2 Questions (1)Where is the boundary? a b c d x 2 x 1 10 Assume: Each input condition is independent
11
1.2 Questions a b c d x 2 x 1 11 (2)How to define neighbors of the boundary?
12
1.2 Questions a b c d x 2 x 1 12 (3)How to choose test data on the boundary?
13
1.2 Questions a b c d x 2 x 1 13 (3)How to choose test data on the boundary?
14
1.2 Questions a b c d x 2 x 1 14 (4)How to design test cases according to the test data?
15
1.2 Questions a b c d x 2 x 1 15 (4)How to design test cases according to the test data?
16
1.2 Questions a b c d x 2 x 1 16 (4)How to design test cases according to the test data?
17
1.2 Questions Assessment of test cases Number of test cases Efficiency of test cases (4)How to design test cases according to the test data? Assume: each test case should only cover one boundary of one input condition 17
18
1.3 Input boundary value testing Where is the boundary? A boundary point of an input condition is such a data that the output changes at it If input conditions specify a range of values bounded by a and b, the boundary is (a) and (b). If input conditions specify a number of values n, the boundary is (n) input values. Apply 1 and 2 to output conditions (e.g., generate table of minimum and maximum size). 18
19
1.3 Input boundary value testing When presented with a software test problem that involves identifying boundaries, look for the following types: Numeric, Speed, Character, Location, Position, Size, Quantity And, think about the following characteristics of those types: First/Last, Min/Max, Start/Finish, Over/Under, Empty/Full, Shortest/Longest, Slowest/Fastest, Soonest/Latest, Largest/Smallest, Highest/Lowest, Next-To/Farthest-From 19
20
1.3 Input boundary value testing Where is the boundary? Boundary points of an input condition are not limited to minimum or maximum data. An input condition may have more than two boundary points. 20
21
1.3 Input boundary value testing How to define neighbors of the boundary? How to choose test data on the boundary? Test cases for variable x, where a<=x<=b a b x 21
22
1.3 Input boundary value testing Boundary: x(min), x(max) Neighbors: x(min) ± 1, x(max) ± 1 Test data: x(min), x(min+), x(min-), x(max), x(max-), x(max+) Test cases for variable x, where a<=x<=b a b x x(min)x(min+)x(nom)x(max -)x(max) 22
23
1.3 Input boundary value testing a b c d x 2 x 1 23 How to design test cases according to the test data?
24
1.3 Input boundary value testing Test cases for a variable x and y, where a<=x<=b and c<=y<=d a b c d y x For x Boundary: a,b Neighbors: a ± 1, b ± 1 Test data:? 24
25
1.3 Input boundary value testing a b c d y x Test cases for a variable x and y, where a<=x<=b and c<=y<=d For x Boundary: a,b Neighbors: a ± 1, b ± 1 Test data: a,a+1,b-1,b Test cases: (a,y0),(a+1,y0),(b-1,y0),(b,y0) 25
26
1.3 Input boundary value testing a b c d y x Test cases for a variable x and y, where a<=x<=b and c<=y<=d For y Boundary: c,d Neighbors: c ± 1, d ± 1 Test data: c,c+1,d-1,d Test cases: (c,x0),(c+1,x0),(d-1,x0),(d,x0) 26
27
1.3 Input boundary value testing a b c d y x Test cases for a variable x and y, where a<=x<=b and c<=y<=d 27
28
28 1.3 Input boundary value testing Let’s test it using input boundary value testing See NextDate
29
1.3 Input boundary value testing Robustness testing ab x x(min) x(min+) x(nom) x(max-) x(max) x(min-)x(max+) Test cases for variable x, where a<=x<=b 29
30
1.3 Input boundary value testing Robustness testing Stress input boundaries Acceptable response for invalid inputs Leads to exploratory testing (test hackers) Can discover hidden functionality 30
31
1.3 Input boundary value testing ab c d y x Test cases for a variable x and y, where a<=x<=b and c<=y<=d 31
32
32 1.3 Input boundary value testing Let’s test it using robustness testing See NextDate
33
1.4 Find boundary in output domain Commission Commission changes with the change of sales a=100b=1000 sales x(min) x(min+)x(max-) x(max) x(min-)x(max+) b=1800b=7800 33
34
34 1.4 Find boundary in output domain Let’s test it by finding boundary in output domain See NextDate
35
Boundary value testing---Summary Is the simplest functional testing method Reason: Errors tend to occur at boundaries of the input domain; Axiom: Select elements at the “edge” of the variable; Assumption: and ; Forms: input boundary value testing, robustness testing, worst case testing, robust worst case testing; 35
36
Boundary value testing---Summary Coverage: not good #tests: moderate to very many Usage: straightforward, easy to implement When to use: independent inputs enumerable quantities, e.g. age (obviously) when suspecting boundary errors 36
37
Boundary value testing---Summary Boundary value testing has Serious redundancy Gaps Boundary value testing is Fundamental Redundant Has gaps 37
38
Thank you 38
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.