It was late at night, and I was at the client's retail warehouse with my QA guy Paul and my Dell 25Mhz 386. We had been cranking out last-minute changes to the customized point-of-sale software (DOS & Clipper!) for the new chain's flagship store a week or two before opening.
We'd been warned that Tom, a Vice-President of the retail group, was going to participate in the acceptance testing, and he liked to catch people out in mistakes. So I was thinking in terms of sanitizing every input, taking into account every possibility of users monkeying with the system, and considering all corner cases. And, did I say it was late at night? I put a few more sanity checks in the code and we went home.
A few days later, Tom came around for the acceptance testing. The area we'd set aside in the warehouse was crowded with managers and executives. We'd already loaded the new POS software onto the hardware that was to be used in the new store. Tom logged onto the system, ran a no-sale transaction, and bing--the drawer opened and the correct audit receipt was printed. He bought a few items, returned them, exchanged them, entered bogus serial numbers, ran an expired credit card, that sort of thing. The system did exactly what it was supposed to.
Tom looked a little disappointed. He shook things up by entering crazy stuff: letters in the quantity fields, making individual payments in pennies, and so on. And it still worked.
Finally, Tom logged his cashier out and logged a new one in. The system prompted for the starting cash amount in the drawer (for comparison to cashing out at shift's end). Instead of something realistic like 100.00 or 200.00, Tom entered...
-999
And the error message came back:
Tom, you know you can't do that!
The crowd went wild with glee. Tom laughed and conceded that we had indeed thought of everything. He signed off on deployment and we went live on the store with very few problems. And we all lived happily ever after.