title: Automated testing a game
body: <p><strong>Question</strong></p>
  
  <p>How would you go adding automated testing to a game?</p>
  
  <p>I believe you can unit test a lot of the game engine's functionality (networking, object creation, memory management, etc), but is it possible to automate test the actual game itself?</p>
  
  <p>I'm not talking about gameplay elements (like Protoss would beat Zerg in map X), but I'm talking about the interaction between the game and the engine.</p>
  
  <p><strong>Introduction</strong></p>
  
  <p>In game development, the engine is just a platform for the game. You could think of the game engine as an OS and the game as a software the OS would run. The game could be a collection of scripts or an actual subroutine inside the game engine.</p>
  
  <p><strong>Possible Answers</strong></p>
  
  <p>My idea is this: </p>
  
  <p>You would need an engine that is deterministic. This means that given one set of input, the output would be exactly the same. This would inlude the random generator being seeded with the same input.</p>
  
  <p>Then, create a bare-bone level which contains a couple of objects the avatar/user can interact with. Start small and then add objects into the level as more interactions are developed.</p>
  
  <p>Create a script which follows a path (tests pathfinding) and interact with the different objects (store the result or expected behavior). This script would be your automated test. After a certain amount of time (say, one week), run the script along with your engine's unit tests.</p>