Professional Documents
Culture Documents
Question- The possible outputs would be previous date or invalid input date. Design the
boundary value test cases.
https://www.niecdelhi.ac.in/uploads/Notes/btech/4sem/cse/21378403-Software-
Engineering-By-K-K-Aggarwal-YogeshSingh-Full-Notes.pdf
The Previous date program takes a date as input and checks it for validity. If valid, it
returns the previous date as its output.
With single fault assumption theory, 4n+1 test cases can be designed and which are
equal to 13.
If any one condition out of C1, C2 or C3 fails, then this function produces an output
“value of month not in the range 1…12”.
Since many combinations of dates can exist, hence we can simply displays one
message for this function : “Invalid Input Date”.
FunctionA very common and popular problem occurs if the year is a leap year. We have
taken into consideration that there are 31 days in a month. But what happens if a month
has 30 days or even 29 or 28 days ?
Furthermore, in this Next Date problem we find examples of Zipf’s law also, which
states that “80% of the activity occurs in 20% of the space”. Thus in this case also,
much of the source-code of Next Date function is devoted to the leap year
considerations.
The Next Date program takes date as input and checks it for validity. If it is valid, it
returns the next date as its output.
Since BVA yields (4n + 1) test cases according to single fault assumption theory, hence
we can say that the total number of test cases will be (4*3+1)=12+1=13.
Test Case ID Month (mm) Day (dd) Year (yyyy) Expected Output
1 6 15 1900 16 June, 1900
2 6 15 1901 16 June, 1901
3 6 15 1962 16 June, 1962
4 6 15 2024 16 June, 2024
5 6 15 2025 16 June, 2025
6 6 1 1962 2 June, 1962
7 6 2 1962 1 June, 1962
8 6 30 1962 1 July 1962
Invalid Date as June has 30
9 6 31 1962
Days
10 1 15 1962 16 January, 1962
11 2 15 1962 16 February, 1962
12 11 15 1962 16 November, 1962
13 12 15 1962 16 December, 1962
This is how we can apply BVA technique to create test cases for our Next Date
Problem.