Sunday, April 23, 2023

Where The $@*&% Are Your Tests?! [VIDEO SUMMARY]

In the video "Where The $@*&% Are Your Tests?!" published by GDC, the speaker, an engineer at Kythera AI, discusses the challenges of implementing unit tests in video game development and shares tips and techniques for making testing more effective. The speaker has extensive experience in the games and simulations industry and has spent years exploring reusable architectures and tools for game development.


The video begins by explaining the concept of unit tests, which are automated pieces of code that invoke a unit of work in a system and check a single assumption about the behavior of that unit of work. Unit tests provide instant feedback on code changes, help document the code, and offer a safety net when the code changes. However, implementing unit tests in video game development can be challenging due to the constantly changing nature of game code.

To make unit tests more effective in game development, the speaker suggests changing the definition of a unit test to focus on testing the system as a whole rather than isolated units. This approach involves writing tests that are fully automated, readable, maintainable, consistent, order agnostic, and fast. By testing larger systems and their dependencies, developers can catch more bugs and improve code coverage.

One technique for writing effective unit tests is to inject the tests into the code, using asserts, errors, and warnings to catch issues. This allows the code to check itself and makes it easier to maintain the tests as the code changes. Additionally, developers can write stress tests to load large maps, create numerous entities, and let the game run for a while to catch potential issues.

The speaker also emphasizes the importance of buy-in and discipline when implementing unit tests in game development. Developers need to be committed to writing tests and maintaining them, even during tight milestones. By incorporating unit tests into the development process, developers can improve their code quality and catch bugs early, ultimately leading to a more efficient and successful game development process.

In conclusion, the video provides valuable insights and advice for developers looking to implement unit tests in their video game projects. By adjusting the approach to testing, focusing on larger systems, and maintaining discipline, developers can reap the benefits of unit testing and create more robust and reliable games.