Integration Testing
Testing & Verification · Test API integration (Leaderboard, NPC AI) with live backend.
Integration Testing
What it is
Integration testing verifies that separate subsystems work together end-to-end. The game alone might work; the API alone might work; the integration tests whether they cooperate correctly under real conditions.
Why it matters
Each piece can pass its own unit tests and still fail when combined. Contract mismatches (the API expects score, the game sends points) are the classic integration bug. Testing against the live backend is the only way to catch them before the player does.
How GateGame implements it
Ran the full flow: complete the maze → submit score to live Leaderboard API → confirm 200 response → reload leaderboard → see the score in the list. Also tested NPC dialogue against the live AI backend with a variety of inputs to make sure responses arrived within a reasonable timeout.
Code Example
// Integration test plan:
// 1. Play level to completion (live game)
// 2. POST score to /api/leaderboard (live backend)
// 3. Confirm 200 response status
// 4. GET /api/leaderboard
// 5. Verify submitted score appears in list
Key Takeaway
Test against the live backend, not a mock. Mocks lie. The network is where the contract really gets tested.