Testcover.com Testcover.com
Tutorial - Functional Dependence -
Fixed Values Procedure

Home
Existing User Login
Brochure
Sign up for Risk-Free Trial
About Testcover.com
Frequently Asked Questions
Tutorial with Examples
->Equivalence Partitioning
--->HTML Form Example
--->Functional Dependence
----->Temperature Example
----->Calendar Example
----->Fixed Values Procedure
--->Shopping Cart Example
----->Seq. Unit Replay Design
->UML State Machines
--->Shopping Cart Example
--->Thermostat Example
->Definitions of Terms
Performance
WSDL Interface
Background
Partners
Registrations
Contact Information

The procedure for converting a request in functionally dependent form to fixed values form is described below. The steps are illustrated with three examples:
    a. The temperature example (introduced above) describes the conversion of one function of one factor, minimum(inScale).
    b. The shopping cart example is based on its UML state machine transition design (introduced below). This example shows the conversion of the event function QTY(i,q) using values from its domain.
    c. The calendar example is similar to those described above. It converts the function last_day(month,year) using values from its range. The example also has a nondeterminant factor, Zip code.

The examples are structured so that they can be followed through the procedure independently, by following their corresponding letters (a, b or c). When a procedure step does not show an example letter, the step does not apply to that example.

Procedure stepExample


1. Identify the partitions having functionally dependent factors, and the functions among their values. Select the first partition and its first function. a. In the temperature conversion example select the minimum(inScale) function for the inTemp factor in the all valid temperatures partition.
Temperature Conversion Example - one function of one factor
inScale
inTemp
outScale
# all valid temperatures
+inTemp depends on inScale
Celsius Fahrenheit Kelvin
minimum(inScale)
Fahrenheit Kelvin Celsius

b. In the shopping cart transition design select the QTY(i,q) function for the event factor in the nonemptyCart to nonemptyCart partition.

The QTY(i,q) event triggers the selection of a new quantity q for cart item i. The factor i can be 0, 1 or 2; it must be less than the number of items in the cart n. Test values chosen for q are 0, 1, 2 and 10.
Shopping Cart Example - functionally dependent form
newItem
n
delChk[0]
item[0]
qty[0]
newQ[0]
delChk[1]
item[1]
qty[1]
newQ[1]
delChk[2]
item[2]
qty[2]
newQ[2]
i
q
state
event
#NN nonemptyCart to nonemptyCart
+ nonemptyCart to nonemptyCart; n=1; QTY
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
0
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=2; QTY
unset
2
0 1
itemA itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
0 1
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=3; QTY
unset
3
0 1
itemA
1 2 10
0 1 2 10
0 1
itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
0 1 2
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
This excerpt contains the blocks in which QTY(i,q) is the event; blocks containing the other events are not shown.

c. In the calendar example select the last_day(month,year) function for the Day factor in the valid dates partition.
Calendar Example with Zip Code - functionally dependent form
Month
Day
Year
Zip code
# valid dates partition, days 1 10 & last day
+ all months; first, tenth and last days; all years
jan feb mar apr may jun jul aug sep oct nov dec
1 10 last_day(month,year)
2015 2016 2017
07722 32819

2. Identify the function's determinant factors. The other factors are nondeterminant for this function. a. In the temperature conversion example the inTemp factor is functionally dependent. Its minimum(inScale) function is determined by the value of the inScale factor. The outScale factor is nondeterminant.

b. In the shopping cart transition design the event factor is functionally dependent. Its QTY(i,q) function is determined by the i and q factors. All the other factors are nondeterminant.

c. In the calendar example the Day factor is functionally dependent. Its last_day(month,year) function is determined by the Month and Year factors. The Zip code factor is nondeterminant.

3. Choose whether to express the function in terms of fixed values from its domain or from its range. Use of the domain values usually will require substitution of the corresponding range values after test case generation. a. The fixed values for the minimum(inScale) function can be expressed as minimum(Celsius), minimum(Fahrenheit) and minimum(Kelvin), or as -273, -459 and 0 respectively.

b. The fixed values for the QTY(i,q) function can be expressed in terms of the allowed combinations of i and q. These are QTY(0,0), QTY(0,1), QTY(0,2), QTY(0,10), QTY(1,0), QTY(1,1), QTY(1,2), QTY(1,10), QTY(2,0), QTY(2,1), QTY(2,2), QTY(2,10). These domain values describe the event that maps the shopping cart state to the expected result. Thus, range values do not apply to this function.

c. There are 36 allowed domain values for the last_day(month,year) function, 12 months • 3 years. However they map to only four range values (28, 29, 30 and 31). Using range values is preferable because they will require fewer blocks in step 7 below.

4. If the function has one determinant factor and specifies all the values of its dependent factor(s) in this partition, then all dependent values and pairs allowed by the determinant factor values will be covered. In this case continue with step 9 to use the fixed values implied by the functionally dependent form, or continue with step 6 to make the fixed values explicit.

Otherwise (a dependent factor is not one function of one factor) proceed to step 5.

a. The minimum(inScale) function has one determinant factor and specifies all the values of the inTemp factor. All the allowed values of inTemp will be covered because they are determined by the given inScale values. And whenever an inScale-outScale pair occurs in a test case, the associated inTemp-outScale pair also must appear. Thus all allowed inTemp-outScale pairs will be covered.

In this example the functionally dependent form is equivalent to the fixed values form. The partition can use a single block expressing the functional dependence minimum(inScale). Or it can use three blocks with the fixed domain values minimum(Celsius), minimum(Fahrenheit), minimum(Kelvin). Or it can use three blocks with the fixed range values -273, -459, 0. All of these choices will yield equivalent test cases covering the same pairs. Choose to continue with step 9.

5. If the function has two determinant factors and specifies all the values of its dependent factor(s) in this partition, then all dependent values allowed by the determinant factor values will be covered. However some dependent-nondeterminant pairs may not be covered. If this is sufficient for test goals, continue with step 9 to use the fixed values implied by the functionally dependent form.

Otherwise (a dependent factor is not one function of two factors, or to cover allowed dependent-nondeterminant pairs) proceed to step 6.

b. The QTY(i,q) function has two determinant factors, but it does not specify all the values of the event factor. The CHECK(i) and UPDATE events also trigger transitions in the nonemptyCart to nonemptyCart partition. Proceed to step 6.

c. The last_day(month,year) function has two determinant factors, but it does not specify all the values of the Day factor. Days 1 and 10 are used in valid dates also. Proceed with step 6.

6. If this function is to be expressed in terms of fixed values from its domain (step 3), include the function's determinant factors in a list of factors requiring separate blocks for fixed values. Continue with step 9.

Otherwise (the function is expressed in terms of its range values), identify the blocks in this partition containing this function. Select the first of these blocks.

b. The QTY(i,q) function is to be expressed in terms of its domain values. Add i and q to the list of factors requiring fixed values. Continue with step 9.

c. The last_day(month,year) function is to be expressed in terms of its range values. There is one block containing the function as follows.
Calendar Example with Zip Code - functionally dependent form
Month
Day
Year
Zip code
# valid dates partition, days 1 10 & last day
+ all months; first, tenth and last days; all years
jan feb mar apr may jun jul aug sep oct nov dec
1 10 last_day(month,year)
2015 2016 2017
07722 32819

7. Select the combinations of determinant values which map to each of the range values for this function. Replace this block with blocks for the individual range values and their corresponding combinations of determinant values. c. The block shown in step 6, example c is replaced with four blocks with last_day(month,year) values 31, 30, 28 and 29 as follows.
Calendar Example with Zip Code - fixed values form
Month
Day
Year
Zip code
# valid dates partition, days 1 10 & last day
+ 31 day months; first, tenth and last days; all years
jan mar may jul aug oct dec
1 10 31
2015 2016 2017
07722 32819
+ 30 day months; first, tenth and last day; all years
apr jun sep nov
1 10 30
2015 2016 2017
07722 32819
+ 28 day month; first, tenth and last day; common years
feb
1 10 28
2015 2017
07722 32819
+ 29 day month; first, tenth and last day; leap year
feb
1 10 29
2016
07722 32819
8. Repeat step 7 for each block containing this function. c. There are no more blocks containing last_day(month,year).
9. If there are additional functions in this partition, select the next one and continue with step 2. a. There are no more functions in this partition.

b. There are no more functions in the excerpt from this partition.

c. There are no more functions in this partition.

10. Select the first determinant factor from the list in step 6 (if any) and proceed with step 11.

Otherwise go to step 15.

a. Go to step 15.

b. Select determinant factor i.

c. Go to step 15.

11. Identify the blocks in this partition containing functions of this determinant factor. Select the first of these blocks. b. Select the first block shown in step 1, example b (n=1).
#NN nonemptyCart to nonemptyCart
+ nonemptyCart to nonemptyCart; n=1; QTY
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
0
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
12. Replace this block with blocks containing the fixed determinant factor values and the corresponding functionally dependent factor values. If there are multiple functions of this determinant factor, include their fixed values. b. Replace the first block (n=1) with one in which i has the value 0 and event has the value QTY(0,q)[0<=i&&i<n].
#NN nonemptyCart to nonemptyCart
+ nonemptyCart to nonemptyCart; n=1; QTY
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
0
0 1 2 10
nonemptyCart
QTY(0,q)[0<=i&&i<n]
13. Repeat step 12 for each block containing functions of this determinant factor. b. Replace the second block (n=2) with two blocks. In the first i has the value 0, and event has the value QTY(0,q)[0<=i&&i<n]. In the second i has the value 1, and event has the value QTY(1,q)[0<=i&&i<n].

Replace the third block (n=3) with three blocks. In the first i has the value 0, and event has the value QTY(0,q)[0<=i&&i<n]. In the second i has the value 1, and event has the value QTY(1,q)[0<=i&&i<n]. In the third i has the value 2, and event has the value QTY(2,q)[0<=i&&i<n].

14. If there are additional determinant factors from the list in step 6, select the next one and continue with step 11. b. Select determinant factor q, which has values 0, 1, 2 and 10.

Replace the block from step 12, example b (n=1) with four blocks. In the first q has the value 0, and event has the value QTY(0,0)[0<=i&&i<n]. In the second q has the value 1, and event has the value QTY(0,1)[0<=i&&i<n]. In the third q has the value 2, and event has the value QTY(0,2)[0<=i&&i<n]. In the fourth q has the value 10 and event has the value QTY(0,10)[0<=i&&i<n].

Make the corresponding replacements for the blocks in step 13, example b (for n=2 and n=3). These are all the blocks for factor q, and there are no more determinant factors on the list. Continue with step 15.

15. If there are additional partitions with functionally dependent factors, select the next partition and its first function. Continue with step 2. a. There are no more partitions in this example.

b. There are no more partitions in this excerpted example.

c. There are no more partitions in this example.

<Calendar Example (revisited) Shopping Cart Example>

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