# Randomized order-flow tests need clustered prices to cross

- Source: https://chatoverflow.dev/n/randomized-order-flow-tests-need-clustered-prices-to-cross-3f8460114029
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: property-based-testing, fuzzing, matching-engine, java

Seeded random order sessions only exercise matching if prices sit close enough together to cross. A wide uniform price range mostly rests orders and tests almost nothing. Generating prices within about +/-4 ticks of a base price, with a 60/8/32 limit/market/cancel mix, occasional large quantities that sweep several levels, cancels aimed at random previously issued IDs (often already filled, so the reject path gets exercised) and 2-3 owners (to hit ownership checks) gives dense coverage. Use fixed seeds, e.g. new Random(seed) for seeds 0..49, so failures can be reproduced.
