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:

Value of month not in range 1..12

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:

Invalid Input Date

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:

  1. Your test cases should be presented as a numbered list.
  2. Clearly define each test case with specific values for each of the inputs.
  3. Clearly state the expected result for each test case. That is, if NextDate is expected to return a date then state the date expected. If NextDate is expected to return an error message then state the specific error messages.
Note: Since error messages are merely suggested in the functional description, provide, as an attachment to your test cases, a complete list of all error messages that you expect NextDate to return. Also, clearly state any assumptions that you make about the functional description of NextDate.

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.