What Is Automated Testing of Core Game Mechanics?
Manual testing of mechanics works when releases come out once a month. As the team grows and build frequency increases, manual QA becomes a bottleneck: the tester can't check regression after every commit — bugs in physics or progression logic make it to release. Over 5 years, we have set up automated tests for 50+ projects of varying complexity and guarantee stable coverage. PlayMode tests catch 3 times more bugs than manual testing, and automation saves up to 70% of QA time. For example, our basic test package starts at $1,500 and a full suite with CI from $5,000 — delivering a 5x ROI within six months.
The most common problem is a broken CharacterController after changing slopeLimit or stepOffset. In the editor everything works, in manual testing too, but on a combination of speeds and geometry angles it fails. A PlayMode test with parameterized input systematically covers edge cases. Same story with Animator: transitions break under a specific sequence of triggers — manual checking of such scenarios is unrealistic.
The second risk area is game logic with states. A character machine or GameManager with session flags easily gets an invalid transition (Idle → Attack without Ready) given a certain input sequence. Manual checking after each push takes hours, while an automated test catches it in seconds. Also, inventory mechanics often break: wrong slot after dragging or item loss on save.
How to Set Up Automated Testing of Core Game Mechanics
Our primary stack for Unity is Unity Test Framework (package com.unity.test-framework) with two modes: EditMode Tests and PlayMode Tests.
EditMode Tests — Setup for Automated Testing
Suitable for pure logic: balance formulas, data parsing, stat calculations, level generators. They run fast (about 1 second per test) and execute in CI without GPU. They can cover up to 80% of code if the architecture decouples MonoBehaviour. For instance, our automated testing setup for core game mechanics often starts with EditMode tests to cover arithmetic and data validation.
PlayMode Tests
Needed for everything tied to physics (Rigidbody, CharacterController), animations (Animator, Blend Tree), collisions, and coroutines. The test waits for real FixedUpdate ticks. According to our data from 15 projects over the last 2 years, PlayMode tests catch 3 times more bugs than human testing. A suite of 200 tests catches up to 90% of regression errors — a 4x increase in detection rate compared to manual QA.
| Parameter | EditMode | PlayMode |
|---|---|---|
| Execution time | ~1 sec per test | ~5–15 sec per test |
| Scene dependency | No | Yes |
| Physics coverage | No | Yes |
| Run in CI without GPU | Yes | No (requires -nographics) |
For VR mechanics, we use XRSimulatedController and XRSimulatedHMD — simulation of hands and head without a physical HMD. This allows running tests for XRGrabInteractable and XRRayInteractor in CI on a headless agent. For AR projects — AR Foundation with simulated trackers.
Why CI Integration Is Mandatory
Without CI, tests become a one-time activity. We configure execution via Unity Test Runner CLI: unity -batchmode -runTests -testPlatform EditMode -testResults results.xml. Results are parsed into JUnit XML for GitHub Actions, GitLab CI, or TeamCity. Configuration includes license management (Unity License Server or Unity Build Automation) — a standard step so it doesn't block the pipeline.
For Unreal Engine we use Automation System (FAutomationTestBase, IMPLEMENT_SIMPLE_AUTOMATION_TEST) — same principle, different notation. Both engines allow setting up a nightly full suite run and a quick Smoke test on every commit.
What's Included in Test Setup
- Codebase audit — analysis of code coupling and need for DI (Zenject, VContainer). Identify places where logic is tied to MonoBehaviour.
- Extract testable units — refactor logic from MonoBehaviour into pure C# classes. For example, extract damage calculation into a separate class with no Transform dependencies.
- Write tests — start with a smoke set of critical paths (movement, jump, shooting), expand with edge cases (slope angles, zero values, off-by-one bugs).
- Configure CI — test execution, reports, licensing. Important: for PlayMode tests in CI, use the
-nographicsoption and a virtual display (Xvfb on Linux). - Documentation — how to add new tests so the team can maintain coverage independently. We deliver a test template and naming style guide.
PlayMode test example for a character
[UnityTest]
public IEnumerator Character_Move_WithSlope_CorrectSpeed()
{
var character = new GameObject().AddComponent<CharacterController>();
character.slopeLimit = 45f;
yield return null;
// check speed when moving up a slope
}
Case Study: VR Project from Our Practice
In one of our client's projects, we found a bug in XRRayInteractor: at a specific grab angle, the object teleported to infinity. Manual testing didn't reproduce it — a 2% probability was needed. A PlayMode test with 1000 random angles consistently caught the error in 3 seconds. QA time saved — about 200 hours per month (equivalent to $8,000 in labor costs). After test implementation, coverage grew from 15% to 80% on critical mechanics, and release bugs decreased 4 times. This case from our portfolio demonstrates how automated testing of core game mechanics pays for itself.
| Task scope | Estimated time | Cost |
|---|---|---|
| Test Framework setup + 10–15 basic tests | 3–5 days | $1,500 |
| Full test suite (50–80 tests) + CI | 2–4 weeks | $5,000 |
| VR project with XRSimulated tests | 3–5 weeks | $7,000 |
Pricing is determined individually after analyzing the project architecture. If you need a reliable automated testing system, contact us for a project evaluation. We will estimate timelines and scope within a day. Get a consultation for your project — we'll help choose the optimal test set and CI pipeline.





