Game Testing All in One (Game Development Series)

Test flow diagrams (TFDs) are graphical models representing game behaviors from the player's perspective. Testing takes place by traveling through the diagram to exercise the game in both familiar and unexpected ways.

TFDs provide a formal approach to test design that promotes modularity and completeness. Testers can enjoy a high degree of TFD reuse if the same behaviors are consistent across multiple game titles or features. This benefit extends to sequels and ports to other platforms. The graphical nature of the TFD gives testers, developers, and producers the ability to easily review, analyze, and provide feedback on test designs.

TFD Elements

A TFD is created by assembling various drawing components called elements . These elements are drawn, labeled, and interconnected according to certain rules. Following the rules makes it possible for your tests to be understood throughout your test organization and makes them easier to reuse in future game projects. The rules will become even more important if your team develops software tools to process or analyze the TFD contents.

Flows

Flows are drawn as a line connecting one game state to another, with an arrowhead indicating the direction of flow. Each flow also has a unique identification number, one event , and one action . A colon (":") separates the event name from the flow ID number and a slash ("/") separates the action from the event. During testing, you do what is specified by the event and then check for the behavior specified by both the action and the flow's destination state . An example flow and each of its components are shown in Figure 11.1.

Figure 11.1: Flow components.

Events

Events are operations initiated by the user , peripherals, multiplayer network, or internal game mechanisms. Think of an event as something that is explicitly done during the game. Picking up an item, selecting a spell to cast, sending a chat message to another player, and an expiring game timer are all examples of events. The TFD does not have to represent all possible events for the portion of the game being tested . It is left up to each tester, who is now in the role of a test designer, to use his knowledge and judgment in selecting the right events that will achieve the purpose of a single TFD or a set of related TFDs. Three factors should be considered for including a new event

  1. Possible interactions with other events.

  2. Unique or important behaviors associated with the event.

  3. Unique or important game states that are a consequence of the event.

Only one event can be specified on a flow, but multiple operations can be represented by a single event. An event name can appear multiple times on a TFD when each instance carries the exact same meaning. Events may or may not cause a transition to a new game state.

Actions

An action exhibits temporary or transitional behavior in response to an event. It is something for the tester to check as a result of causing or performing an event. Actions can be perceived through human senses and gaming platform facilities, including sounds, visual effects, game controller feedback, and information sent over a multiplayer game network. Actions do not persist over time. They can be perceived, detected, or measured when they occur but can no longer be perceived, detected , or measured some time later.

Only one action can be specified on a flow, but multiple operations can be represented by a single action. An action name can appear multiple times on a TFD when each instance carries the exact same meaning.

States

States represent persistent game behavior and are re-entrant . As long as you don't exit the state you will continue to observe the same behavior, and each time you return to the state you should detect the exact same behavior.

A state is drawn as a "bubble" with a unique name inside. If the same behavior applies to more than one state on your diagram, consider whether they could be the same state. If so, remove the duplicates and reconnect the flows accordingly . Each state must have at least one flow entering and one flow exiting.

Primitives

Events, actions, and states are also referred to as primitives .

Primitive definitions provide details of the behavior represented on the TFD without cluttering the diagram. Primitive definitions form a "data dictionary" for the TFD. These definitions could be in text (for example, English), a software language (for example, C), or an executable simulation or test language (for example, TTCN). See the "Data Dictionary" section later in the chapter for details and examples.

Terminators

These are not machines from the future programmed for war. Terminators are special boxes placed on the TFD that indicate where testing starts and where it ends. Exactly two terminators should appear on each TFD. One is the IN box, which normally has a single flow that goes to a state. The other is the OUT box, which has one or more flows entering from one or more states.

Категории