Game Development Reference
In-Depth Information
Enumerations
Many choices in a game are made from a set of distinct values or options that do not
have any particular numerical or sequential relationship to one another. Choosing
which car to drive, or which baseball team to play, or which fighter to use are exam-
ples of this kind of choice.
Regardless of the number of unique choices (team, car, fighter, weapon, song, hair-
style, and so on), each one should be represented somewhere in your tests. It's easy to
find bugs that happen independent of which particular choice is made. The ones that
do escape tend to only happen for a very few of the choices.
Ranges
Many of the game options and choices require the player to pick a number from a
range or list. This could be done by directly entering a number or scrolling through a
list to make a selection. For each range of numbers, three particular values tend to
have special defect-revealing properties: Zero, Minimum, and Maximum.
Anytime a zero (0) is a presented as a possible choice or entry, it should be included in
testing. This is partly due to the unique or ambiguous way that the value 0 might affect
the game source code. Here is a partial list of possible unintended zero-induced effects:
A loop may prematurely exit or may always do something once before checking
for zero
Confusion between starting loop counts at 0 or 1
Confusion with arrays or lists starting at index 0 or 1
0 is often used to represent special meaning, such as to indicate an infinite
timer or that an error has occurred
0 is the same value as the string termination (NULL) character in C
0 is the same value as the logical (Boolean) False value in C
Minimum values are also a good source of defects. They can be applied to numerical
parameters or list choices. Look for the opportunity to use minimum values with
parameters related to the following:
Time
Distance
Speed
Quantity
Size
Bet amount
Search WWH ::




Custom Search