Assignment #2
SE433 - Software Testing
CSC366 - Software Quality Assurance
Due: 11/4/2002
Consider the following functional description of a NextDate function. This is a simple example of a function that may be available in a library of date manipulation functions from a database management system.
Functional Description:
The NextDate function should accept three input variables: month, day, and year. It should return a formatted string which is the date of the day after the input date. The month, day, and year variables should be integer values subject to the following constraints:
NextDate should return a specific error message for any input value that does not satisfy its constraint. For example, if the input variable month has the value 15, NextDate should return the string:
Similar messages should be returned for invalid day and year values.
NextDate should also return an error message for invalid logical combinations of input values. For example, if month has the value 6 and day the value 31 (i.e. June, 31st) then NextDate should return the string:
Since many invalid day-month-year combinations exist, this generic message is acceptable for any invalid logical combinations.
Note: NextDate must handle leap years correctly. That is, a year is a leap year if it is divisible by 4, unless it is a century year. Century years are leap years only if they are multiples of 400 (e.g. 1992, 1996, and 2000 are leap years, but 1900 is not).
Question:
Given the description of the NextDate function above, and considering the Black Box testing techniques, Equivalence Partitioning, Boundary-Value Analysis, and Error Guessing, derive a thorough set of test cases that may be used to test the NextDate function.
Make sure of the following:
Extra Credit (+10%):
Think carefully about the leap year problem. How would this problem affect your choice of equivalence classes. Show how the resulting equivalence classes will result in a more robust set of test cases. Note that you may think of the leap year problem as the dependency issue discussed in class (see the section titled Independence Presumption in the week #5 lecture notes.