Why so many
Agents work quickly and in parallel, and they change things in places they cannot always see. A test suite is the shared memory of what must stay true. Every time a workstream finishes, the whole suite runs before its work is merged. At the time of writing there are 146 test files and about 2,200 individual tests, and the whole suite passes before work is merged.
The race simulation is written so it can be tested: it is pure TypeScript with a fixed step of 60 updates a second and no graphics inside it. That means a test can create a race, feed it inputs and step it forward thousands of times in a second, with no browser at all.
What the tests check
- Physics and fairness: the four karts finish three laps within about 2.5 per cent of each other on every circuit, with and without drifting, so no kart is simply best.
- Fuzzing: eight karts mashing random buttons for minutes at a time, checking every step that nothing becomes infinite, leaves the course or gets stuck.
- The computer racers: on the World Tour courses, eight AI karts of different skills finish three laps with no respawns; in Bump Battle a player who does nothing loses within about a minute, while a sloppy human still wins sometimes.
- Every course: the validator, every jump driven by the real simulation at different speeds, landmarks in plain sight from the road, solid obstacles kept out of the driving line.
- The respect rules: measured as numbers, for example that the road edge in Makkah stays at least 15 metres outside the real plaza outline and that no straight points at the Kaaba.
- Multiplayer: the lobby, the binary messages, the relay, room codes and a fake version of the server that drops connections on purpose.
- Audio: that the default music never calls a melodic instrument, on any world, in any cue.
- This website: that every world and its unlock time on these pages matches the game's own schedule, and that the holy-city entries carry no stunt words.
Tests that run the real game
Some things can only be checked in a browser, so there are also play-test scripts that open the game in a headless browser, click through the menus, race and take screenshots. A separate harness ran up to eight players in browser tabs with real connections between them, and a mock of the online service checked joining when the first connection is deliberately killed. Those runs are slow on our machine, so they are used before releases rather than on every change.
What tests cannot tell you
Tests say the jump in a course is safe; they cannot say it is exciting. They say the computer racers are beatable; they cannot say a race felt fair. So the other half of testing is playing. Many of the changes in the history came from playing on a phone: the speed cut by 15 per cent after people said it was a little too fast, drifts made easier to start, the computer's Bump Battle aim softened against human players who are behind.
We also keep a list of what has not been tested, and it is public in the repository: sixteen real players online, voice chat on a real phone, a game between two different networks. If you hit a problem in one of those, please tell us.