Download presentation
Presentation is loading. Please wait.
Published byOwen Eric Peters Modified over 9 years ago
1
CEN 5070 – Software V&V BOUNDARY TESTING © 2001-2008, Dr. E.L. Jones
2
2/2000Unit Test Concepts2 Agenda More on Boundary Points & Values Automated Test Data Generation Boundary Testing Approach Test Set Reduction Strategies
3
2/2000Unit Test Concepts3 BOUNDARY TESTING DESIGN METHODOLOGY Specification Identify elementary boundary conditions Identify boundary points Generate boundary test cases Update test script (add boundary cases).
4
2/2000Unit Test Concepts4 (1) Specification Compute pay for an hourly employee, given the number of hours worked and the hourly pay rate. Compute overtime at 1.5 times hourly rate for hours in excess of 40. Software under Test HoursPay Rate
5
2/2000Unit Test Concepts5 (2) Identify Boundary Conditions Condition 1 (bc1): Hours <= 40 Observations: Condition taken directly from decision table
6
2/2000Unit Test Concepts6 (3) Identify Boundary Points bc1 Boundary Points Point 1: AT the boundary: Hours = 40 Point 2: Just INside: Hours = 39 Point 3: Just OUTside: Hours = 41 Observations: The Hours value must be paired with Rate Inclusive inequalities have 3 boundary points
7
2/2000Unit Test Concepts7 (4) Generate Test Cases Combine Hours boundary points with Rate Case 1 (AT): Hours = 40, Rate = 10, Pay=400 Case 2 (IN): Hours = 39, Rate = 10, Pay=390 Case 3: (OUT): Hours = 41, Rate=10, Pay=415 Observations: Test each boundary point individually Then consider pair-wise boundary points
8
2/2000Unit Test Concepts8 (5) Update Test Script Step StimuliExpected Response HoursRatePay = 1 2 30 5010 300 550 34010400 43910390 54110415
9
2/2000Unit Test Concepts9 Your Turn Boundary Testing c1: Age <= 12 | Y N N c2: Age > 65 | Y N N c3: Age > 80 | Y c4: Weight > 300 | Y N N N N c5: Weight > 120 | N Y a1: Pills = 0 | X X a2: Pills = 1 | X a3: Pills = 2 | X X a4: Pills = 2+(W-120)/50 | X Decision Table:
10
2/2000Unit Test Concepts10 Your Turn (2-3) Boundary Conditions/Points Boundary Condition Boundary Point (BP) ATIN bc1: OUT bc2: bc3: bc4: bc5:
11
2/2000Unit Test Concepts11 Your Turn (4) Generate Boundary Test Cases To create a test case, you must pair an Age with a Weight Weight boundary point + NOMINAL Age Age boundary point + NOMINAL Weight OUT Age + OUT Weight A nominal value is one that is not close to a boundary point. For simplicity, use the same nominal value in all test cases.
12
2/2000Unit Test Concepts12 Your Turn (4) Boundary-Nominal Test Cases Condition btc BC Weight Age Expect Weight>300 1 IN 301 21 0 2 OUT 300 21 Age <= 12 3 IN 220 11 4 AT 12 5 OUT 13 Age > 65 6 IN 7 OUT Age > 80 9 IN 10 OUT Weight>120 11 IN 12 OUT
13
2/2000Unit Test Concepts13 Your Turn (4) Out-Out Boundary Test Cases Condition OUT BP Weight Age btc Weight Age Expect >300 <=12 13 >65 14 >80 15 >120 <=12 16 >65 17 >80 18
14
2/2000Unit Test Concepts14 OBSERVATIONS Functional testing defines a minimal number of test cases Boundary testing adds a large number of test cases, but are EASY to create Boundary testing finds lots of errors!
15
2/2000Unit Test Concepts15 BOUNDARIES EXIST FOR Optional fields: (present, missing). Variable length data: null string, max length Database tables: empty Searching: first/last position File: closed, empty
16
2/2000Unit Test Concepts16 Agenda More on Boundary Points & Values Automated Test Data Generation Boundary Testing Approach Test Set Reduction Strategies
17
2/2000Unit Test Concepts17 Agenda More on Boundary Points & Values Automated Test Data Generation Boundary Testing Approach Test Set Reduction Strategies
18
2/2000Unit Test Concepts18 Tools for Boundary Testing Ref – MS thesis, Jermaine Stewart, 2006 Versions: BTDgen.run, BTDgenGUI.run Unix invocation: % BTDgen BTDgen: specification Boundary Test Sets Full cartesian product – high volume [btd_xxx.txt] Reduced set (nominal values) [bnc_xxx.txt] Specification: var declarations + boundary conditions.
19
2/2000Unit Test Concepts19 Agenda More on Boundary Points & Values Automated Test Data Generation Boundary Testing Approach Test Set Reduction Strategies
20
2/2000Unit Test Concepts20 Boundary Test Set Reduction Cartesian product yields exponential size Boundary-nominal yields linear size By-passes “masking” problem Multiple boundaries not tested Combinatorial methods applied to each variable’s boundary value set.
21
2/2000Unit Test Concepts21 RANDOM TESTING Beyond scope of this lecture Used to bombard software with inputs (high volume testing) No effort to identify expected results Appropriate for automated load testing, where concern is for capacity/volume.
22
2/2000Unit Test Concepts22 MAIN POINTS BLACK-BOX TESTING Black-box = spec-based testing Tests intentions Key knowledge = stimuli and responses Decision table organizes S/R conditions Boundary testing flushes coding errors Black-box test case design can drive software design -- same issues addressed
23
2/2000Unit Test Concepts23 PUTTING IT ALL TOGETHER Test design is a systematic process whether you use decision tables or not, you must understand the factors influencing and influenced by the behavior of the unit The sooner you design test cases, the better Test design is more crucial than running tests Reveals assumptions, omissions and errors Use test cases during design and coding
24
2/2000Unit Test Concepts24 SOLUTIONS TO EXERCISES
25
2/2000Unit Test Concepts25 Your Turn (2) Identify Boundary Conditions Condition 1 (bc1): Age <= 12 Condition 2 (bc2): Age > 65 Condition 3 (bc3): Age > 80 Condition 4 (bc4): Weight > 300 Condition 5 (bc5): Weight > 120
26
2/2000Unit Test Concepts26 Your Turn (3) Identify Boundary Points Boundary Condition Boundary Point ATIN bc1: Age <= 12 OUT bc2: Age > 65 bc3: Age > 80 bc4: Weight > 300 bc5: Weight > 120 1211 66 81 301 121 13 65 80 300 120
27
2/2000Unit Test Concepts27 Your Turn (4) Boundary-Nominal Test Cases Condition btc BC Weight Age Expect Weight>300 1 IN 301 21 0 2 OUT 300 21 5 Weight>120 3 IN 121 21 2 4 OUT 120 21 2 Age <= 12 5 AT 220 12 1 6 IN 220 11 1 7 OUT 220 13 4 Age>65 8 IN 220 66 2 9 OUT 220 65 4 Age>80 10 IN 220 81 0 11 OUT 220 80 2
28
2/2000Unit Test Concepts28 Your Turn (4) Out-Out Boundary Test Cases Condition OUT B-point Weight Age btc Weight Age Expect >300 <=12 12 300 13 5 >65 13 300 65 5 >80 14 300 80 5 >120 <=12 15 120 13 2 >65 16 120 65 2 >80 17 120 80 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.