# Test the edge of each rule deliberately

> Find edge-case failures by testing limits for movement, timing, screen edges, score counters and repeated input in a small browser game.

- URL: https://oneshotgems.ai/topics/testing-game-boundaries
- Category: For game developers
- Type: Guide
- Updated: October 5, 2026

Many game defects occur where a rule changes: the last pixel before a ledge, the final allowed item, zero time on a timer, or an input received during a restart. Boundary testing means choosing values just below, exactly at, and just beyond a limit, then checking that each outcome is intentional. It is especially helpful for a generated prototype, where ordinary play can look fine while a corner case quietly awards an extra point or leaves the player stuck.

## Map the limits before you try to break them

List rules with a threshold. If a gate opens at three keys, check two keys, exactly three, and four keys if the player can collect extras. If a platform ends at a screen boundary, approach it slowly, quickly, and while jumping. If the timer ends a round at zero, observe the frame just before zero, the transition at zero, and an input immediately afterward. These cases expose off-by-one logic and overlapping transitions.

## Probe time and repeated input

Press an action once, hold it, and tap it rapidly. These patterns can reveal whether a jump repeats, a menu advances twice, or one pickup is counted more than once. Test input just before and just after a state change, such as pressing restart as a game-over overlay appears. If the game animates with requestAnimationFrame, background tabs can affect when animation callbacks run; include a hide-and-return case for mechanics that depend on elapsed time.

## Questions

**What does “just below, at, and above” mean in a game test?** Choose values on both sides of a rule threshold and exactly on it. For a three-key gate, test with two keys, three keys, and any reachable count above three.

**Are hidden-tab pauses always a bug?** No. Decide whether time should pause or continue while hidden, then test the chosen behavior. The important part is that timers and animation resume according to a clear rule.

## Follow your curiosity

- [How to Reproduce a Browser Game Bug](https://oneshotgems.ai/topics/reproducing-game-bugs): Turn a confusing game failure into a reproducible report by capturing the build, setup, exact inputs, expected result and observed result.
- [Make Browser Game Tests Repeatable](https://oneshotgems.ai/topics/deterministic-game-tests): Control random values, time and starting conditions so game tests produce comparable outcomes and failures are easier to diagnose.

## Further reading

- [MDN requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame)

---
Canonical page: https://oneshotgems.ai/topics/testing-game-boundaries
