Testing framework

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Testing framework

      I'm getting sick of manually checking functionality by hand. In my previous experience we would make "regression tests" - run the executable in a terminal with a set of inputs and measure several outputs. If the measurements change you know what you broke.

      Since games are so interactive I'm not sure how to set up a testing platform in this same way. The book seems to talk about testing a lot but I don't remember any specific strategies. Any suggestions?

      So far I am just perusing unit test frameworks on wiki. en.wikipedia.org/wiki/List_of_unit_testing_frameworks. I also know CTest is a part of CMake. More specific examples would be nice though. Thanks :)
    • Unit tests unfortunately don't cover games very well, they work for things like low level engine code, but fail with less 'logical' situations. Some ideas for you;
      • Have an automated AI tester, which can run the game at high speeds, possibly even simulating device input.
      • Have user interaction tracking, this is used for many things ie. Monetization (yuck), however being able to see "Player 3 encountered a bug in level 2, just past checkpoint D, while pressing 'F' and receiving damage from an enemy", it is a good starting point to at least know the reproduction steps as sometimes human testers can be less than accurate ie. "games broke when enemies hit you"
      • Having a 'cheat' menu, which allows you to jump to any given situation will speed up your testing iteration time greatly, such as 'load level 2' or 'award key', things that would normally take time through player progression.
      • Unit tests are still useful, use them where they make sense, but don't expect them to pay off everywhere.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • On the Sims 4, we had both unit tests and a "gui smoke". The unit tests were used to test gameplay systems. For example, the statistic system I wrote had unit tests to test all the crazy on-demand simulation we did.

      The gui smoke actually ran the game and performed a number of interactions to test the real game itself. It generally ran things that tended to break, like motive solving and death.

      One if the big motivations for the human view vs ai view is to be able to facilitate this kind of thing. It's not too hard if you can set up your game engine to handle it from the beginning. Modifying an existing engine to make it work is much harder.

      -Rez
    • rezination wrote:


      One if the big motivations for the human view vs ai view is to be able to facilitate this kind of thing. It's not too hard if you can set up your game engine to handle it from the beginning. Modifying an existing engine to make it work is much harder.

      -Rez


      I guess I will see how well my version was implemented! I kept the same abstraction but who knows if it worked right.