Testcover.com
Tutorial - Calendar Example

Home
Existing User Login
Brochure
Sign up for Risk-Free Trial
About Testcover.com
Frequently Asked Questions
Tutorial with Examples
->Need for the Service
->Submitting Requests
->Reading Results
->Configuration Example
->Constraints Example
->Calendar Example
->Database Table Example
->Finite State Machine
->Hierarchical State Machine
->Definitions of Terms
Performance
WSDL Interface
Background
Partners
Subscription Prices
Subscription Activations
Student Subscriptions
Privacy Policy
Terms & Conditions
Contact Information


The Calendar Example illustrates the use of the test case generator with error conditions. This situation is different from the previous example which had impossible combinations to avoid. Here there are combinations which need to be tested, but they reflect abnormal conditions. These combinations lead to "rainy day" test cases which must be handled differently than "sunny day" cases.

Consider a calendar system which has three test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1. Month12 jan feb mar apr may jun jul aug sep oct nov dec
2. Day7 1 10 28 29 30 31 32
3. Year32011 2012 2013
The tester plans to try several allowed dates, including first and last days of each month. She also will try problem dates beyond the month boundaries (e.g. Month jan with Day 32) to check that the system handles error cases correctly. One error test case that could be generated is
feb292013
This is an error test case because 2013 is not a leap year: February has only 28 days in 2013. If this is the only test case which pairs the Month feb with Day 29, there would be a gap in exercising the normal operation of the calendar. The feb-29 pair would not be tested in an allowed date in a leap year. The tester knows that the calendar system behaves differently during error handling, so she plans to cover the feb-29 pair as a normal day in a leap year (2012) and as an error case (in 2013) also.

This is easily accomplished with two partitions, one for normal dates and one for months that are too long. There are constraints among the factor values in both partitions due to the varying month lengths. Thus both partitions have multiple blocks. Any combination of values in a block is an allowed test case.

The request for this example is shown below.
Calendar Example
Month
Day
Year
#ok All good dates
jan feb mar apr may jun jul aug sep oct nov dec
1 10
2011 2012 2013
+ long month last day
jan mar may jul aug oct dec
31
2011 2012 2013
+ short month last day
apr jun sep nov
30
2011 2012 2013
+ feb last day
feb
28
2011 2013
+ leap day
feb
29
2012
#err Too long month
+ too long long month
jan mar may jul aug oct dec
32
2011
+ too long short month
apr jun sep nov
31
2012
+ feb too long, regular year
feb
29
2013
+ feb too long, leap year
feb
30
2012

The two results tables follow. This example illustrates the use of Test Case ID prefixes (ok and err) to distinguish between test cases from different partitions. Optional partition comments also are shown.

Note that the feb-29 pair is covered in both partition results.

#1. All good dates
Test
Case ID
MonthDayYearCombo
Countdown
12 Values6 Values3 Values126
ok1jan12011123
ok2jan102012120
ok3feb102011117
ok4feb12013114
ok5mar12012111
ok6mar102013108
ok7may312013105
ok8aug312012102
ok9oct31201199
ok10nov30201296
ok11apr30201393
ok12jun30201190
ok13feb29201287
ok14apr1201185
ok15apr10201283
ok16may10201181
ok17jun1201279
ok18jun10201377
ok19jul1201175
ok20jul10201273
ok21aug10201171
ok22aug1201369
ok23sep10201167
ok24sep1201265
ok25oct10201263
ok26nov10201161
ok27nov1201359
ok28dec10201157
ok29dec1201255
ok30jul31201353
ok31dec31201351
ok32jan31201349
ok33mar31201147
ok34sep30201345
ok35feb28201143
ok36may10201242
ok37may1201341
ok38oct1201140
ok39oct10201339
ok40feb28201338

#2. Too long month
Test
Case ID
MonthDayYearCombo
Countdown
12 Values4 Values3 Values96
err1jan32201193
err2apr31201290
err3feb29201387
err4feb30201284
err5mar32201182
err6may32201180
err7jul32201178
err8aug32201176
err9oct32201174
err10dec32201172
err11jun31201270
err12sep31201268
err13nov31201266

The PowerPoint presentation Pairwise Testing Comes of Age gives a further discussion on the selection of test input data based on the system state and expected results. A similar example starting on slide 24 explains these ideas in more detail.

<Constraints Example Database Table Example>

Copyright © 2003-2010 Testcover.com, LLC. All rights reserved.