Tuesday, June 15, 2010

BWAPI Test Framework Plan

This week I'm at a family reunion at the Mahoney State Park in Nebraska. I brought my laptop but the internet connection is really flaky, so I can't really work on BWAPI this week. However I'll be coming back in two days and I've made a plan for how to create the BWAPI test framework.

First I will create test maps for Zerg and Protoss and simplify the test map for Terran. Once a test map for each race is completed, I'll then write test cases that proceed in the following chronological order from match start:

  1. Test initial game/force/player/unit information - make sure they all return the correct initial values for the given test map.
  2. Test unit production, construction, and (for Zerg) morphing by creating every possible unit for the given race. This will also include asserts to make sure functions like Unit::getBuildType and Unit::getTrainingQueue return the correct information while the units are produced.
  3. Re-test the game/player/unit information - make sure they all return the correct updated values for the given test map now that step 2 has completed. This will also verify that step 2 completed successfully.
  4. Test the Unit::upgrade and Unit::research functions by researching each upgrade and tech, making sure the relevant functions in the Player class return the correct information at each step along the way.
  5. Test the Unit::useTech functions for each TechType (special ability). This will verify that BWAPI issues each special ability correctly for each spell-casting unit, and also test to make sure the correct error codes are generated in cases where the special abilities cannot be executed.
  6. Test the other unit commands, making sure the the unit information functions return the correct values before, during, and after each command. Each command will be tested in isolation and return the unit to a non-cloaked, non-burrowed, non-sieged, non-lifted idle state.

No comments:

Post a Comment