Designing and Maintaining Tests

As you design and maintain tests for your system, keep the following points in your mind:

  1. Ease of use and debugging are the highest priority. Everyone on the team should be able to run and debug the tests. Use your creativity to make the tests easy to run and debug instead of focusing on the most up to date library or style. If the test requires special hardware or backends that only one person in the team has, then this person will have to run the test for the whole team whenever needed which is not scalable or that test won’t be used. 
  2. Focus on the right priorities. There is an unlimited number of tests that the team can create for the system, create them in the order of priority. For example, if you are building functional integration tests, cover the breadth of the system user-facing features first before digging deeper into rarely features. This may sound obvious, but obscure features may need some highly technical solutions and some engineers like to start with these because of the technical challenge. For example, it may be technically challenging to simulate a rare multithreading scenario in your game’s backend. What is more appropriate, spending a week to solve this the technical challenge or spending that week to write tests that cover the game playing logic? Given that your time is limited, implement the high priority tests first.
  3. Make sure your tests keep up with your system. Software systems are continuously changing. The system features and dependencies change, tests should also change. The team should always make sure that the existing tests evolve with the system and cover it properly. For larger systems, the integration tests that people have to run on submitting code should continue to cover the highest priority features of the system.