Black Box Testing: Test Boundary Values
Programmers tend to make mistakes at the boundaries of equivalence classes. Think of the mistakes you may have made when specifying the start and end points of a for loop. Boundary value analysis guides the creation of test cases at the boundaries or edges of a problem. When testing a boundary, you want to test the boundary itself. You also want to test the values immediately on either side of the boundary.
The input for hours worked for the Paycheck program has two boundaries as illustrated in Figure 3. We want to test the boundary of 0 and the values to either side. We also want to test the boundary of 40. Some tests for the boundary are shown below.
Test ID | Description | Expected Results | Actual Results |
---|---|---|---|
Boundary regular hours, Two insurances, Level 3, Boundary retirement |
Preconditions: Paycheck program started Employee Name: Bob Baker Employee Level: 3 Hours Worked: 1 Medical Insurance (Y/N): N Dental Insurance (Y/N): Y Vision Insurance (Y/N): Y Retirement Percentage (0-6): 1 |
Name Hours PayRate Regular OT Gross Deduc. Net Bob Baker 1.00 25.75 25.75 0.00 25.75 20.80 4.95 |
|
Boundary regular hours, One insurance, Level 3, Boundary retirement |
Preconditions: Paycheck program started Employee Name: Ellen Edwards Employee Level: 3 Hours Worked: 39 Medical Insurance (Y/N): N Dental Insurance (Y/N): N Vision Insurance (Y/N): Y Retirement Percentage (0-6): 5 |
Name Hours PayRate Regular OT Gross Deduc. Net Ellen Edwards 39.00 25.75 1004.25 0.00 1004.25 55.46 948.79 |
|
Boundary regular hours, One insurance, Level 3, Boundary retirement |
Preconditions: Paycheck program started Employee Name: Frank Frankenstein Employee Level: 3 Hours Worked: 40 Medical Insurance (Y/N): Y Dental Insurance (Y/N): N Vision Insurance (Y/N): N Retirement Percentage (0-6): 6 |
Name Hours PayRate Regular OT Gross Deduc. Net Frank Frankenstein 40.00 25.75 1030.00 0.00 1030.00 86.30 943.70 |
|
Boundary overtime hours, One insurance, Level 3, Mid-range retirement |
Preconditions: Paycheck program started Employee Name: George George Employee Level: 3 Hours Worked: 41 Medical Insurance (Y/N): N Dental Insurance (Y/N): Y Vision Insurance (Y/N): N Retirement Percentage (0-6): 2 |
Name Hours PayRate Regular OT Gross Deduc. Net George George 41.00 25.75 1030.00 38.62 1068.62 36.67 1031.95 |