Game Development Reference

In-Depth Information

Calculating Inverted Usage

Inverted usage is calculated using a three-step process.

1. Calculate the reciprocal of each usage probability for a test parameter (com-

binatorial) or for all paths exiting a state (TFDs).

2. Sum the reciprocals.

3. Divide each reciprocal from step 1 by the sum of the reciprocals calculated

in step 2. The result is the inverted probability for each individual usage

value.

For example, say there are three values A, B, and C with the usage 10%, 50%, and 40%,

respectively. Apply step 1 of the inversion process to get reciprocal values of 10.0 for

A (1/0.10), 2.00 for B (1/0.5), and 2.50 (1/0.40) for C. Add these reciprocals to get a

sum of 14.5. The reciprocals are divided by this sum to get the inverted values of

69.0% (10/14.5) for A, 13.8% (2/14.5) for B, and 17.2% (2.5/14.5) for C. The can be

rounded to 69%, 14%, and 17% for test generation purposes.

One characteristic of this process is that it inverts the proportions between each prob-

ability as compared to its companions for a given set of usage values. In the preceding

example, B is used five times more frequently than A (50/10) and 1.25 times more fre-

quently than C (50/40). The relationship between inverted A and inverted B is

69%/13.8%, which is 5.00. Likewise, the relationship between inverted C and inverted

B is 1.25 (17.2%/13.8%).

For any case where there are only two usage values to invert, you can skip the math and

simply reverse the usage of the two values in question. You will get the same result if you

apply the full process, but why bother when you could use that time to do more testing?

Note

If an item has a 0% usage, then the first step in the inversion process will cause a divide by zero

situation. Keep that from happening by adding 0.01% to each value before doing the three-step

inversion calculation. This will keep the results accurate to one decimal place of precision in the

results and maintain the relative proportions of usages in the same set.

Combinatorial Table Usage Inversion

Figure 12.3 showed a set of usage probabilities for the
HALO
Look Sensitivity test values

of 1, 3, and 10. Construct a table of inverted values starting with the Casual player profile.

The three usage probabilities in that column are 10, 85, and 5. These are percentages, so

the numerical values of these probabilities are 0.10, 0.85, and 0.05. Apply step 1 and

calculate 1/0.10 = 10. Do the same for 1/0.85, which is 1.18, and 1/0.05, which equals 20.