Generating Test Cases in Unity Engine: A Case Study of My Indie Game – Cube
Keywords:
Automated Test Case Generation, Random Search-Based Testing, Model-Based TestingAbstract
The development of video games requires extensive testing to ensure functionality and player satisfaction. However, manual testing of game mechanics can be time-consuming and prone to errors. This project focuses on addressing the inefficiencies in manual testing by introducing automated test case generation techniques for game mechanics validation. Traditional manual testing approaches often fail to cover all possible game states and transitions, leading to undetected bugs and suboptimal gameplay experiences. To address this, the project employs two different automated test case generation methods, which are random search-based testing and model-based testing to evaluate game mechanics with maximized path exploration and path logging. The generated test cases will then be executed using Unity's Test Framework to verify their accuracy. The approach is applied to Cube, an indie 3D puzzle-platformer game where the player navigates through a cube-shaped environment to reach specific targets while avoiding obstacles and enemies. The results show that model-based testing is better than random-based testing in terms of execution time and test coverage. However, it is recommended to have hybrid approach by combining both methods to ensure higher defect detection efficiency. Additionally, this project demonstrates the applicability of automated testing methods in indie game development, setting a foundation for broader adoption in similar domains.



