I worked on a tool at Amazon once that incorrectly calculated royalties, not because Amazon was greedily trying to steal from publishers, but just because of general incompetence (or, lack of sufficient competence maybe). Basically, of the people who wrote the tool, tested the tool, and used the tool, none of them knew exactly how royalties should be calculated and none of them could tell whether or not they were bei…
Why was this not defined in a spec document and checked in a unit test? Everywhere I've worked where there were defined formulae (or formulae to be defined) this kind of thing was meticulously checked for correctness. No one should have shipped the service without knowing if the calculations were correct!
A big part of the problem with the situation I'm discussing here is that the people who were using the tool were using it incorrectly. The people using the tool (which made offers available to specific customers in certain conditions) did not understand the nuances of the different price values on offers and how they connected with royalties.
I forget the specifics, but imagine someone working with publishers to setup special offers and entering prices into our tool and they just populate two of the three different "Price" fields with the same price because they don't know the difference between "list price" and "my price" and they put the right value in "discount price" (or whatever the terms were). Totally unknown to the person entering the offer, royalties are (incorrectly) calculated based on one of those columns that they have now put a technically incorrect value into. Even if there was a perfectly clear spec, and there wasn't, and it had been implemented perfectly, the tool still would've failed because the people using it didn't really understand the system either.