Writing the rules before the code
Before any payment code existed, we wrote down how places and money move: holds, refunds, waitlist offers, resale and payouts. Then we tried to break those rules on paper, and found real holes. A full game couldn’t resell a drop-out’s place. The last place could be confirmed twice through an expired hold. A 3D Secure check that went through late could book someone into a game that had already been called off. The second version closed these holes, and a concurrency test suite races separate processes against the database to check that two bookings can’t claim the same place.