Monday, June 21, 2010

Test Framework Progress

I've been working on the test framework over the last few days and I've finished step two of the plan I outlined in my last post. The TestAIModule now produces every possible building and unit which doesn't require an upgrade or special ability for each of the 3 test maps (TerranTest.scm, ProtossTest.scm, and ZergTest.scm). While these units and buildings are created, lots of asserts are performed to make sure relevant functions return the correct information. By checking the results on every frame, I've been able to find and fix bugs that would only appear for a frame or two, and then disappear. While this test framework is still far from complete, creating these test cases has allowed me to discover and fix the following 13 bugs:

  1. Fixed a bug where Unit::getType would not immediately switch to Egg/Lurker Egg/Cocoon after issuing a morph command to a unit
  2. Fixed a bug where Unit::getBuildType would return UnitTypes::None for Terran buildings that were constructing add-ons
  3. Fixed a bug where Unit::getBuildType would sometimes return UnitTypes::None for morphing Zerg units
  4. Fixed a bug where Unit::getBuildUnit would return NULL for incomplete Terran add-ons that are being constructed.
  5. Fixed a bug where Unit::getRemainingBuildTime would sometimes return incorrect values for morphing Zerg units
  6. Fixed a bug where Unit::getRemainingTrainTime would incorrectly return 0 on some frames due to latency.
  7. Fixed a bug where Unit::isBeingConstructed would return false for morphing Zerg units
  8. Fixed a bug where Unit::isConstructing would return false for Terran buildings that are constructing add-ons
  9. Fixed a bug where Unit::isConstructing would return false for incomplete Terran add-ons that are being constructed.
  10. Fixed a bug where Unit::isConstructing would return false morphing Zerg units
  11. Fixed a bug where Unit::isIdle would sometimes return true when the unit is constructing
  12. Fixed a bug where Unit::isIdle would return true morphing Zerg units
  13. Fixed a bug where Unit::isTraining would not return true for Reavers or Carriers.

While writing these test cases was a pain, I'm starting to see how useful and important a proper test framework is for finding and fixing bugs :). My next goal will be to create test cases that research each upgrade and special ability. After that I will create test cases for using each special ability.

No comments:

Post a Comment