Download presentation
Presentation is loading. Please wait.
Published byKerry Annabel Woods Modified over 6 years ago
1
WARNING 20 min These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint They may not show up well on other PowerPoint versions. You can download PowerPoint 2010 viewer from here. These slides contain a lot of animations. For optimal results, watch in slideshow mode.
2
What is an Equivalence Partition?
How does it help to improve E&E of testing? What are the EPs for name in the method below? /** * Adds the name to the course list. name must be between 5 to 50 chars (both inclusive) * and not already in the course list */ void addName(String name) { … } 5..50 Case sensitivity? Leading/trailing spaces? < 5 in the list not in the list > 50 null Empty string
3
Equivalence partitioning
How to choose? E&E of testing Some heuristics Test case Equivalence partitioning
4
Equivalence partitioning Boundary value analysis
How to choose? E&E of testing Some heuristics Test case Equivalence partitioning Boundary value analysis
5
Equivalence partitioning Boundary value analysis
How to choose? E&E of testing Some heuristics Test case Equivalence partitioning Boundary value analysis
6
Boundary value analysis
7
isValidMonth (int m): boolean
Boundary value analysis isValidMonth (int m): boolean MIN_INT 1 12 13 MAX_INT
8
isValidMonth (int m): boolean
Boundary value analysis isValidMonth (int m): boolean MIN_INT 1 12 13 MAX_INT
9
isValidMonth (int m): boolean
Boundary value analysis isValidMonth (int m): boolean MIN_INT 1 12 13 MAX_INT if(m>=1)||(m<12) … if(m>=1)||(m<=12) …
10
isValidMonth (int m): boolean
Boundary value analysis isValidMonth (int m): boolean MIN_INT 1 12 13 MAX_INT
11
isValidMonth (int m): boolean
Boundary value analysis isValidMonth (int m): boolean MIN_INT 1 12 13 MAX_INT
12
What are the boundary values for i?
Boundary value analysis What are the boundary values for i? isPrimeNumber (int i):boolean Description: Checks if i is a prime number. Returns true if i is a prime number, false otherwise. Not prime numbers Prime numbers
13
What are the boundary values for i?
Boundary value analysis What are the boundary values for i? isPrimeNumber (int i):boolean Description: Checks if i is a prime number. Returns true if i is a prime number, false otherwise.
14
BVA helps to improve E&E by …
How to choose? E&E of testing Some heuristics Test case Equivalence partitioning Boundary value analysis BVA helps to improve E&E by …
15
Equivalence partitioning Boundary value analysis
How to choose? E&E of testing Some heuristics Test case Equivalence partitioning Boundary value analysis Combining multiple inputs
16
Equivalence partitioning Boundary value analysis
How to choose? E&E of testing Some heuristics Test case Equivalence partitioning Boundary value analysis Combining multiple inputs
17
Combining multiple inputs
:MSLogic markCellAt(x,y)
18
Combining multiple inputs
markCellAt(x,y) markCellAt(x,y)
19
Combining multiple inputs
markCellAt(x,y) MSLogic x y Cell GAME_STATE
20
[MIN_INT..-1] [0..(W-1)] [W..MAX_INT] [MIN_INT..-1] [0..(H-1)]
Combining multiple inputs markCellAt(x,y) x y Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST [MIN_INT..-1] [0..(W-1)] [W..MAX_INT] [MIN_INT..-1] [0..(H-1)] [H..MAX_INT] W -> Width H -> Height
21
[MIN_INT..-1] [0..(W-1)] [W..MAX_INT] [MIN_INT..-1] [0..(H-1)]
Combining multiple inputs markCellAt(x,y) x y Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST [MIN_INT..-1] [0..(W-1)] [W..MAX_INT] [MIN_INT..-1] [0..(H-1)] [H..MAX_INT] MIN_INT, -2, -1,0, 2, (W-1), W, W+1, MAX_INT
22
[MIN_INT..-1] [0..(W-1)] [W..MAX_INT] [MIN_INT..-1] [0..(H-1)]
Combining multiple inputs markCellAt(x,y) x y Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST [MIN_INT..-1] [0..(W-1)] [W..MAX_INT] [MIN_INT..-1] [0..(H-1)] [H..MAX_INT] MIN_INT, -2, -1,0, 2, (W-1), W, W+1, MAX_INT MIN_INT, -2, -1,0, 2, (H-1), H, H+1, MAX_INT
23
HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY
Combining multiple inputs markCellAt(x,y) x y Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST MIN_INT, -2, -1,0, 2, (W-1), W, W+1, MAX_INT MIN_INT, -2, -1,0, 2, (H-1), H, H+1, MAX_INT
24
HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY
Combining multiple inputs markCellAt(x,y) Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST y MIN_INT, -2, -1,0, 2, (H-1), H, H+1, MAX_INT x MIN_INT, -2, -1,0, 2, (W-1), W, W+1, MAX_INT
25
HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY
Combining multiple inputs markCellAt(x,y) Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST y MIN_INT, -2, -1,0, 2, (H-1), H, H+1, MAX_INT x MIN_INT, -2, -1,0, 2, (W-1), W, W+1, MAX_INT
26
2025 HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY
Combining multiple inputs markCellAt(x,y) Cell GAME_STATE HIDDEN MARKED CLEARED INC_MARKED INC_CLEARED PRE_GAME READY IN_PLAY WON LOST y MIN_INT, -2, -1,0, 2, (H-1), H, H+1, MAX_INT x MIN_INT, -2, -1,0, 2, (W-1), W, W+1, MAX_INT 9x9x5x5= 2025
27
Combining multiple inputs
28
77577 OR tinyurl.com/answerpost
Combining multiple inputs gender size speed female large fast male medium slow blank small 3x3x2= 18 Payment for testing: $100 Cost per test case: $10 Penalty for uncaught bug: $200 Work out a set of test cases that is both E&E. How many do you have? count {answer} e.g. count 9 OR tinyurl.com/answerpost
29
18 gender size speed female large fast male medium slow blank small
Combining multiple inputs gender size speed female large fast male medium slow blank small 3x3x2= 18 Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2
30
18 gender size speed female large fast male medium slow blank small
Combining multiple inputs gender size speed female large fast male medium slow blank small 3x3x2= 18 Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2
31
18 gender size speed female large fast male medium slow blank small
Combining multiple inputs gender size speed female large fast male medium slow blank small 3x3x2= 18 Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2
32
Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2 Heuristic : Each valid input should appear at least once without invalid inputs
33
Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2 Heuristic : Each valid input should appear at least once without invalid inputs
34
Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2 Case gender size speed Output 1 female large fast behavior 1 2 male -any valid - slow behavior 2 2a medium error 1 3 blank small -any - error 2 Heuristic : Each valid input should appear at least once without invalid inputs
35
Case gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2 Case gender size speed Output 1 female large fast behavior 1 2 male -any valid - slow behavior 2 2a medium error 1 3 blank small -any - error 2 Heuristic : Each valid input should appear at least once without invalid inputs
36
Heuristic: Only one invalid input per test case
gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2 Case gender size speed Output 1 female large fast behavior 1 2 male -any valid - slow behavior 2 2a medium error 1 3 blank small -any - error 2 Heuristic: Only one invalid input per test case
37
Heuristic: Only one invalid input per test case
gender size speed Output 1 female large fast behavior 1 2 male medium slow error 1 3 blank small -any - error 2 Case gender size speed Output 1 female large fast behavior 1 2 male -any valid - slow behavior 2 2a medium error 1 3 blank small -any - error 2 Heuristic: Only one invalid input per test case
38
Heuristic: Only one invalid input per test case
gender size speed Output 1 female large fast behavior 1 2 male -any valid - slow behavior 2 2a medium error 1 3 blank small error 2 5 3x3x2= 18 Case gender size speed Output 1 female large fast behavior 1 2 male -any valid - slow behavior 2 2a medium error 1 3 blank error 2 4 small error 3 Heuristic: Only one invalid input per test case
39
Combining multiple inputs Equivalence partitioning
How to choose? E&E of testing Some heuristics Combining multiple inputs Test case Equivalence partitioning Boundary value analysis
41
Apply in *some* places. e.g.
//5 is a boundary value for size assertEquals(5, getSize());
45
Test case design heuristics
Other QA techniques Test case design heuristics
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.