Test Tree Designs


On the other end of the spectrum, some features can seem downright chaotic . Take, for example, card battle games. In these games players take turns playing cards from a deck they have assembled . Winning the game usually involves eliminating the opponent , his creatures , or both. A card may have a special behavior as defined by the text on the card. Some cards can affect other players or cards. There are cards for offensive and defensive purposes. Hundreds of different cards can potentially interact and affect each other in unexpected or undesirable ways. Remember Rule #1 ‚ don't panic! Create a test tree design to derive a set of tests for special card capabilities.

For example, a test tree design could be created for the Black Pendant Yu-Gi-Oh! card in the Eternal Duelist Soul game for the GameBoy Advance. This card is shown in Figure 13.5 and the card text reads as follows :

"A monster equipped with this card increases its ATK by 500 points. When this card is sent from the field to the Graveyard, inflict 500 points of Direct Damage to your opponent's Life Points."


Figure 13.5: Black Pendant card.

There is other information you need to know about the game to understand this card. Players ("duelists") battle each other by summoning monsters and casting spells from among the cards they hold in their hands. A new card is drawn at the beginning of each player's turn unless there is a spell or effect in play that prevents that from happening. A player can put cards into play from his hand. Some cards require a "Cost" to be put into play, such as loss of life points or sending a card to the graveyard. Cards that are in play are said to be in the "field." Field cards can be face up, or in a special face-down "Set" position. Cards that have somehow been destroyed are put face up into a "graveyard" pile. These cards can still play a role in the outcome of the game, because there are spells and effects that can bring cards in either player's graveyard back onto the field. There are also ways to remove cards from the game. This prevents their return via graveyard effects. Such cards are set aside away from the area of play.

Specific types of cards can be put into play. Monster cards can be used to attack the opponent or defend against her attacks. Some monsters have special abilities that can affect other monsters or cards.

There are two types of spell cards: Magic Cards and Trap Cards. Spells can be beneficial or destructive and can affect creatures, players, or other spells. In addition to affecting cards already in play, they can also affect cards in a player's hand, deck, or graveyard. Some spells affect multiple cards and some can only target a single card.

Create a design to test the rule described in the second sentence of the Black Pendant card text. Two criteria must be met for the card to inflict 500 points of direct damage to your opponent:

  1. The card is sent from the "field" and

  2. The card is sent to the "graveyard"

From the brief description of the game just provided, you know that the card can either be in a player's hand, field, or graveyard, or removed from the game. Likewise, a card can be sent to a hand, field, or graveyard.

Establish the top level of the tree using the "from" criteria. This should include all of the "zones" that the card can originate from. Use rounded symbols for this design tree to distinguish it from the test case and game function trees shown earlier in this chapter. Also place some text at the top of the column to help remember what function these nodes represent. Your result should look like Figure 13.6.


Figure 13.6: Top level of Black Pendant test tree.

Now add the "to" criteria possibilities. Since a card does not get sent to the same place it came from, exclude those branches from the tree. For example, there should not be a Hand branch below the top-level Hand node. Further constrain the tree by only including branches that contain at least one of the success criteria ("from hand" or "to graveyard"). This set of constraints eliminates the Graveyard-Graveyard branch, so remove the Graveyard node from the Card "from" level. At this stage of development the tree should look like Figure 13.7.


Figure 13.7: Two-level Black Pendant test tree design.

The next level of the tree should cover the possible causes of the removal of the Black Pendant card. From the preceding game description, this could be caused by a Magic, Spell, or Monster card. Figure 13.8 includes the addition of the cause nodes.


Figure 13.8: Black Pendant test tree design with causes added.

Finally, proceed through each Caused by node and add the possible categories of affected cards: One, Multiple, and All. Additionally, cards can be sent to a deck, hand, or graveyard as part of the cost to activate the effect of another card. This limits the Cost cause to branches that have Graveyard as the Goes "to" choice. The distinction between Multiple and All is that a Multiple card effect involves a selection process to determine which cards are affected, whereas the All effect does not involve this process. Figure 13.9 reflects the expanded tree structure for the Deck-Graveyard branch.


Figure 13.9: Expanded Deck-Graveyard branch.

In the last step of the design process, identify at least one card that meets the criteria for each end node of the tree. Reduce the tree along the way by identifying branches that are not possible given the abilities of the cards that are available in the game. For example, there is no Magic card that could send All players' Black Pendant cards from their deck to the graveyard, so the All node is eliminated from the Deck-Graveyard-Magic Card branch. In the case of the Trap Card, none of the ones provided in this game title send any cards from the deck to the graveyard, so Trap Card and its child nodes can be eliminated entirely from the Deck-Graveyard branch. Figure 13.10 shows the trimmed and completed Deck-Graveyard branch.


Figure 13.10: Trimmed and completed Deck-Graveyard branch.

This simplifies things quite a bit, but don't rely on that happening every time you use this technique. The important part is that you identify the possible effects and then seek out examples within the game. Sometimes a missing example might be the result of missing functionality in the game. You might even find some defects without even having to run a test!

Complete the structure for the Hand-Graveyard branch. It should look like Figure 13.11.


Figure 13.11: Expanded Hand-Graveyard branch.

Once again, carry out the identification and reduction process. Some of the card effects on this branch are not provided by any of the cards in this game, so more nodes will get trimmed, resulting in Figure 13.12.


Figure 13.12: Trimmed and completed Hand-Graveyard branch.
Note ‚  

If you want to look up the details yourself for any of the cards used in this game, see Prima's Official Strategy Guide for Yu-Gi-Oh! The Eternal Duelist Soul .

Next, start processing the Card "from" Field-to-Deck branch. It just so happens that in this game there are no Magic, Trap, or Monster cards that send a card from the Field back to a player's deck, so this entire branch is eliminated from testing.

Next, expand the Field-Hand branch. There is one Magic card ‚ Giant Trunade ‚ that performs this function and affects All magic cards on the field. No Trap or Monster cards have this effect.

A variety of cards can send Black Pendant from the Field to the Graveyard. In the Magic card category, Mystical Space Typhoon can affect one card, Harpie's Feather Duster can affect multiple cards, and Heavy Storm will affect All magic cards on the field. Trap cards Driving Snow and Magical Hats can affect One or Multiple cards, respectively. Armed Ninja is a Monster capable of sending one Black Pendant card from the Field to the Graveyard. Figure 13.13 shows the test tree design branches for Black Pendant leaving the Field.


Figure 13.13: Test tree design portion for Field branch.

At this point you have finished defining the test cases from the original scope of the test tree design structure in Figure 13.8. The tests you have defined so far concern themselves with how the Black Pendant card itself is affected during the battle, but there is another design consideration to take into account. Since Black Pendant is used to "equip" a monster in play, the Black Pendant card is sent to the graveyard whenever the "host" monster leaves the field. This last-minute addition illustrates the iterative discovery process that can take place when using this design approach. Attempting to draw out the tree also draws out new knowledge, ideas, and insights regarding the game, leading to better testing. It's very important that you eagerly include new (valid) ideas in your tests instead of keeping them to yourself because you are embarrassed or fear punishment for not having thought of them sooner.

Add a main Host branch to the tree. Fashion this new branch to follow the same structure as the major Field branch. Figure 13.14 shows the additional Host branch.


Figure 13.14: Host branch added to Black Pendant test tree design.

Go through the same pruning process that you did for the previous branches. The Host-Deck branch only has one node ‚ the Morphing Jar #2 card for Monster-All. Similarly, the Host-Hand branch has two nodes resulting from the Crass Clown (Monster-One) and Penguin Soldier (Monster-Multiple) cards. These trimmed portions of the tree are shown in Figure 13.15.


Figure 13.15: Host-Deck and Host-Hand branches of the Black Pendant test tree design.

The Host-Graveyard branch is completely populated . The game has at least one example for each of the Magic, Trap, and Monster scenarios represented in the tree, as shown in Figure 13.16.


Figure 13.16: Host-Graveyard branch of the Black Pendant test tree design.

Figures 13.17 and 13.18 show (in two parts ) the complete structure of this test tree, with the specific card names removed. The result is that you found 31 tests to perform for verifying the proper behavior of the Black Pendant card.


Figure 13.17: Final Black Pendant test tree design structure, Part 1.

Figure 13.18: Final Black Pendant test tree design structure, Part 2.

In the same way that the test case tree was discussed in the "Test Case Trees" section earlier in this chapter ‚ used to identify a narrow scope of tests to run for a given set of code changes ‚ this test tree can pinpoint a narrow range of game behaviors to repair when a defect is found. For example, in the course of running the preceding tests, it turns out that the 500 points of damage are not applied when the monster equipped with Black Pendant is destroyed (removed from the Field) to pay for a monster's (Cannon Soldier) effect. This corresponds to the Host-Graveyard-Monster-Cost node in the test tree design. Once the game software is updated to fix this defect, it would make sense to re-run all of the Host-Graveyard-Monster tests as well as tests for each Cost node.

A second defect occurs when Morphing Jar #2's effect sends the Host monster back to the player's deck. This is on the Host-Deck-Monster-All node. Were this to occur by itself, you could plan on re-running Host-Deck-Monster and the *-All tests. Given the fact that there are now two bugs associated with Host-*-Monster branches, I would recommend re-running all Host-*-Monster tests once the bugs are fixed instead of just the Host-Deck Monster and Host-Graveyard-Monster tests.

One final caution. Be careful about trying to reuse test trees for sequels to previous titles. In the collectible card game example, the tree may not be complete for Yu-Gi-Oh! titles released after Eternal Duelist Soul . This is because new card mechanics, card types, card restrictions, and/or rule changes can be introduced as new cards are released to the public and included in subsequent videogames . Go back to the point prior to fitting specific cards to each branch and use that as your starting point for completing your test tree designs for newer titles.

This design technique is also useful to fill in the "whitespace" of any feature where you already have experience or intuition of what should be tested , but want to ensure more complete testing, especially concerning various interaction or situational possibilities. In addition to applying this technique to card battle games, you may also find test tree designs useful for testing things like computer opponent AI, networked game message processing, or spell interactions and combinations.




Game Testing All in One
Game Testing All in One (Game Development Series)
ISBN: 1592003737
EAN: 2147483647
Year: 2005
Pages: 205

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net