Testcover.com Testcover.com
Tutorial - Constraints 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
->Equivalence Partitioning
->UML State Machines
->Definitions of Terms
Performance
WSDL Interface
Background
Partners
Registrations
Contact Information



The constraints example shows how to generate test configurations for a networked computer system that has constraints among browsers and operating systems. There are five test factors with values as follows.
Test FactorNumber of ValuesTest Factor Values
1. Operating system4XP MacOS Linux Vista
2. Display resolution3low medium high
3. Connection4wi-fi dsl cable lan
4. Browser4IE Firefox Opera Safari
5. Application3App1 App2 App3
The test cases need to be constrained to include only supported configurations. In this example the IE browser runs on XP and Vista; Firefox and Opera run on all 4 of the operating systems; and Safari runs on XP, MacOS and Vista. The supported configurations are included by using multiple blocks which are defined so that the union of their test cases spans all the allowed test cases. This can be done with 3 blocks in this example:
• On XP, MacOS, Linux or Vista run Firefox or Opera
• On XP or Vista run IE or Safari
• On MacOS run Safari
There are various ways to choose the blocks. The key here is that any test case defined by a block is allowed. When the blocks are taken together, they define all the allowed test cases and no disallowed ones. It is possible to specify blocks that are disjoint or overlapping in various ways. These block definitions are equivalent when they include all the allowed combinations. However different block definitions lead to minor variations in the resulting test cases.

The following request illustrates the constraints example with the 3 blocks chosen above. (The text following the plus (+) on the first line of the block is an optional comment.)
Constraints Example
Operating System
Display resolution
Connection
Browser
Application
#
+ (XP MacOS Linux Vista) with (Firefox Opera)
XP MacOS Linux Vista
low medium high
wi-fi dsl cable lan
Firefox Opera
App1 App2 App3
+ (XP Vista) with (IE Safari)
XP Vista
low medium high
wi-fi dsl cable lan
IE Safari
App1 App2 App3
+ MacOS with Safari
MacOS
low medium high
wi-fi dsl cable lan
Safari
App1 App2 App3

The results table is shown below. It has columns for a Test Case ID, for each test factor and for a Combo Countdown. The top row of the table labels these columns. The next row shows the number of values for each factor and the total number of factor value pairs in the Combo Countdown column.
Test
Case ID
Operating System Display resolution Connection Browser Application Combo
Countdown
4 Values3 Values4 Values4 Values3 Values129
1MacOSlowlanOperaApp1119
2Vistahighwi-fiOperaApp2109
3LinuxmediumcableOperaApp399
4VistamediumdslFirefoxApp189
5XPlowlanFirefoxApp380
6MacOShighcableFirefoxApp271
7MacOSmediumwi-fiSafariApp362
8XPlowwi-fiIEApp154
9LinuxlowdslOperaApp247
10VistalowcableSafariApp340
11XPmediumdslIEApp334
12XPhighcableIEApp228
13VistamediumlanSafariApp222
14MacOShighdslSafariApp116
15LinuxhighlanFirefoxApp212
16Linuxmediumwi-fiFirefoxApp19
17XPhighcableOperaApp17
18XPhighwi-fiSafariApp35
19VistalowdslIEApp24
20XPlowlanIEApp13

In this example there are

4 • 3+ 4 • 4+ 4 • 4+ 4 • 3
+ 3 • 4+ 3 • 4+ 3 • 3
+ 4 • 4+ 4 • 3
+ 4 • 3= 129
uncovered pairs of values before any test cases are run. The row labeled 1 gives the values of the test factors for the first test case. It also shows that after the first test case is run, 119 pairs of values remain uncovered. (10 pairs of values are covered by each of the first four test cases.) Successive rows give the generated test cases with their corresponding numbers of uncovered factor value pairs in the Combo Countdown column. After test case number 20, all but three pairs of values are covered. These are the three unsupported combinations which cannot be tested: Linux with IE, Linux with Safari, and MacOS with IE.

In this example there must be at least 4 • 4 = 16 test cases to include the pairs of values for the two factors with the most values (4). If there were no constraints, the generator would produce exactly 16 test cases here. However because there are constraints in the test system, a few additional test cases are required.

<Configuration Example Calendar Example>

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