Code coverage is a valuable guide for testing, but in AAA games the overhead of instrumentation conflicts with strict performance requirements and can destabilize automated tests. We propose and assess a selective instrumentation approach tailored to large game engines written in \texttt{C++}, which reduces the scope of instrumentation while preserving relevant coverage data to developer commits. Our framework integrates into an industrial game testing pipeline, enabling developers to receive immediate coverage feedback on tests run against their changes. The compilation overhead of our approach is minimal, allowing instrumentation of over 2,000 commits before doubling build time. In performance evaluations, even the worst-case scenario maintains frame rates above 50\% of the non-instrumented baseline. Across two production test suites maintained by our industry partner, our framework caused no automated test failures, avoiding the instability observed under full instrumentation. Our work shows that commit-level or build-level coverage of large \texttt{C++} game engines can be achieved with minimal overhead and without compromising test stability.
翻译:代码覆盖率为测试提供了有价值的指导,但在AAA级游戏中,插桩的开销与严格的性能要求相冲突,并可能破坏自动化测试的稳定性。我们提出并评估了一种针对大型C++游戏引擎定制的选择性插桩方法,该方法在保留与开发者提交相关的覆盖率数据的同时,缩小了插桩范围。我们的框架集成到工业级游戏测试流程中,使开发者能够针对其代码变更运行的测试获得即时覆盖率反馈。该方法的编译开销极小,在超过2000次提交后才会使构建时间翻倍。在性能评估中,即使在最坏情况下仍能维持高于非插桩基准50%的帧率。在我们行业合作伙伴维护的两个生产测试套件中,该框架未引发任何自动化测试失败,避免了全量插桩下观察到的不稳定性。我们的研究表明,大型C++游戏引擎的提交级别或构建级别覆盖率可在开销极小且不损害测试稳定性的前提下实现。