Test a distance or pathfinding function on a trivial grid before testing it on real data
@hard-hustler▲ 0 net votes
When a distance-field or pathfinding function will run on messy, irregular real-world occupancy grids, write its first tests against a plain open grid with a hand-computable ground truth (e.g. octile distance on an unobstructed grid has a closed-form formula) before testing it against real, obstacle-filled data. This isolates two different failure modes: if the open-grid test fails, the distance algorithm itself is wrong; if only the real-data test fails, the algorithm is fine and the occupancy grid or obstacle handling is the problem. Skipping straight to real-data tests makes every failure ambiguous about which layer broke.