1 / 45

Equivalence Partitioning and Boundary Value Analysis for Testing Improvement

Learn about equivalence partitioning and boundary value analysis and how they help improve testing effectiveness and efficiency. Explore examples and heuristics for test case selection.

savannahj
Download Presentation

Equivalence Partitioning and Boundary Value Analysis for Testing Improvement

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 2010. 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. * @param 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? > 50 in the list < 5 not in the list null Empty string

  3. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case Test case Equivalence partitioning

  4. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case Test case Equivalence partitioning Boundary value analysis

  5. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case Test case Equivalence partitioning Boundary value analysis

  6. Boundary value analysis

  7. Boundary value analysis isValidMonth(int m): boolean 0 1 12 13 MAX_INT MIN_INT

  8. Boundary value analysis isValidMonth(int m): boolean 0 1 12 13 MAX_INT MIN_INT

  9. Boundary value analysis isValidMonth(int m): boolean 0 1 12 13 MAX_INT MIN_INT if(m>=1)||(m<12) … if(m>=1)||(m<=12) …

  10. Boundary value analysis isValidMonth(int m): boolean 0 1 12 13 MAX_INT MIN_INT

  11. Boundary value analysis isValidMonth(int m): boolean 0 1 12 13 MAX_INT MIN_INT

  12. Boundary value analysis What are the boundary values for i? isPrimeNumber(inti):boolean Description: Checks if i is a prime number. Returns true if iis a prime number, false otherwise. Prime numbers Not prime numbers

  13. Boundary value analysis What are the boundary values for i? isPrimeNumber(inti):boolean Description: Checks if i is a prime number. Returns true if iis a prime number, false otherwise.

  14. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case Test case Equivalence partitioning Boundary value analysis BVA helps to improve E&E by …

  15. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case Test case Equivalence partitioning Boundary value analysis Combining multiple inputs

  16. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case 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. 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. 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. 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. 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. 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. 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. 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. Combining multiple inputs 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 77577OR tinyurl.com/answerpost

  29. Combining multiple inputs 3x3x2= 18

  30. Combining multiple inputs 3x3x2= 18

  31. Combining multiple inputs 3x3x2= 18

  32. Heuristic : Each valid input should appear at least once without invalid inputs

  33. Heuristic : Each valid input should appear at least once without invalid inputs

  34. Heuristic : Each valid input should appear at least once without invalid inputs

  35. Heuristic : Each valid input should appear at least once without invalid inputs

  36. Heuristic: Only one invalid input per test case

  37. Heuristic: Only one invalid input per test case

  38. 5 3x3x2= 18 Heuristic: Only one invalid input per test case

  39. How to choose? E&E of testing Some heuristics Test case Test case Test case Test case Test case Test case Test case Test case Equivalence partitioning Boundary value analysis Combining multiple inputs

  40. Apply in *some* places. e.g. • //5 is a boundary value for size • assertEquals(5, getSize());

  41. Other QA techniques Test case design heuristics

More Related