In: Computer Science
1 Consider a program for the determination of Previous date. Its input is a triple of day, month and year with the values in the range
1 ≤ month ≤ 12
1 ≤ day ≤ 31
2000 ≤ year ≤ 2125
The possible outputs are “Previous date” and “Invalid input date”.
Design the test cases using the following:
Show the full details to apply the testing part
Scenario given for testing:
Consider a program for the determination of Previous date. Its input is a triple of day, month and year with the values in the range
1 ≤ month ≤ 12
1 ≤ day ≤ 31
2000 ≤ year ≤ 2125
The possible outputs are “Previous date” and “Invalid input date”.
1] Decision table-based testing.
Decision table built in this testing method is a tabular representation of inputs versus rules/cases/test conditions.
| Conditions | Rule 1 | Rule 2 | Rule 3 | Rule 4 | Rule 5 | Rule 6 | Rule 7 | Rule 8 |
| Day (T/F) | F | F | F | F | T | T | T | T |
| Month (T/F) | F | F | T | T | F | F | T | T |
| Year (T/F) | F | T | F | T | F | T | F | T |
| OUTPUT (P/I) | I | I | I | I | I | I | I | P |
Legend:
T - Correct Input in given range (Day/Month/Year)
F - Wrong Input in given range (Day/Month/Year)
P - Previous Date (Expected output)
I - Invalid Input Date (Error message)
Interpretation:
Rule-8: Enter valid day, month, year and the expected result will be the user should get the previous date.
Rule-1 to Rule-7: Enter invalid day- month-year(one/two/all three invalid input) and the expected result will be the user should get an error message 'Invalid input date'.
2] Worst case testing
Here we consider cases where more than 1 variable has extreme values.
i.e.
1) Range: 1 ≤ month ≤ 12
In these test-cases, month variable can be given values 1, 2, 12, 11
(
minimum value in range - 1
close to minimum value in range - 2
maximum value in range - 12
close to maximum value in range - 11
)
2) Range: 1 ≤ day ≤ 31
day variable can be given values 1, 2, 31, 30
(
minimum value in range - 1
close to minimum value in range - 2
maximum value in range - 31
close to maximum value in range - 30
)
3) Range: 2000 ≤ year ≤ 2125
year variable can be given values 2000, 2001, 2125, 2124
(
minimum value in range - 2000
close to minimum value in range - 2001
maximum value in range - 2125
close to maximum value in range - 2124
)
These values can be used to set up the test cases for worst case testing.