1 / 11

Boundary Value Testing Example

Boundary Value Testing Example. Boundary Value Testing Example . Process employment applications based on a person's age. Notice the problem at the boundaries. The age "16" is included in two different equivalence classes (as are 18 and 55). . Boundary Value Testing Example (cont) .

jaron
Download Presentation

Boundary Value Testing Example

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. Boundary Value Testing Example SWE 415 Boundary Value Testing Example

  2. Boundary Value Testing Example • Process employment applications based on a person's age. • Notice the problem at the boundaries. The age "16" is included in two different equivalence classes (as are 18 and 55). SWE 415 Boundary Value Testing Example

  3. Boundary Value Testing Example (cont) • Boundary value testing focuses on the boundaries simply because that is where so many defects hide. • If (applicantAge >= 0 && applicantAge <=16) hireStatus="NO"; • If (applicantAge >= 16 && applicantAge <=18) hireStatus="PART"; • If (applicantAge >= 18 && applicantAge <=55) hireStatus="FULL"; • If (applicantAge >= 55 && applicantAge <=99) hireStatus="NO"; SWE 415 Boundary Value Testing Example

  4. Boundary Value Testing Example (cont) • Perhaps this is what our organization meant: 0–15 Don't hire 16–17 Can hire on a part-time basis only 18–54 Can hire as full-time employees 55–99 Don't hire • What about ages -3 and 101? • The requirements do not specify how these values should be treated. SWE 415 Boundary Value Testing Example

  5. Boundary Value Testing Example (cont) • The code that implements the corrected rules is: If (applicantAge >= 0 && applicantAge <=15) hireStatus="NO"; If (applicantAge >= 16 && applicantAge <=17) hireStatus="PART"; If (applicantAge >= 18 && applicantAge <=54) hireStatus="FULL"; If (applicantAge >= 55 && applicantAge <=99) hireStatus="NO"; • The interesting values on or near the boundaries in this example are {-1, 0, 1}, {15, 16, 17}, {17, 18, 19}, {54, 55, 56}, and {98, 99, 100}. • Other values, such as {-42, 1001, FRED, %$#@} might be included depending on the module's documented preconditions. SWE 415 Boundary Value Testing Example

  6. Boundary Value Testing Example (cont) The steps for using boundary value testing are : 1- Identify the equivalence classes. 2- Identify the boundaries of each equivalence class. 3- Create test cases for each boundary value by choosing one point on the boundary, one point just below the boundary, and one point just above the boundary. "Below" and "above" are relative terms and depend on the data value's units. SWE 415 Boundary Value Testing Example

  7. Boundary Value Testing Example (cont) • You could, of course, create additional test cases farther from the boundaries (within equivalence classes) if you have the resources. • Boundary value testing is most appropriate where the input is a continuous range of values. SWE 415 Boundary Value Testing Example

  8. Boundary Value Testing Example (cont) Test data input of {$999, $1,000, $1,001} on the low end and {$83,332, $83,333, $83,334} on the high end are chosen to test the boundaries. Boundary values for a discrete range of inputs. SWE 415 Boundary Value Testing Example

  9. Boundary Value Testing Example (cont) SWE 415 Boundary Value Testing Example

  10. Boundary Value Testing Example (cont) Plotting "monthly income" on the x-axis and "number of dwellings" on the y-axis shows the "locations" of the test data points SWE 415 Boundary Value Testing Example

  11. Boundary Value Testing Example (cont) Note • Four of the input combinations are on the boundaries while eight are just outside. • The points outside always combine one valid value with one invalid value (just one unit lower or one unit higher). SWE 415 Boundary Value Testing Example

More Related