Using Contract Testing to Verify an API
We’ve all had to sign a contract before. Maybe it was when you were buying a house, starting a new job, or opening a bank account. There are many reasons that we sign contracts. I have a filing cabinet where I keep important paperwork and I suspect that about half of the documents in there are contracts of some sort.
Not all contracts are explicit. If I wanted a load of gravel for my driveway, I could call up a gravel company and ask them to deliver it. They would do so under the implicit contract assumption that I would pay them for the gravel once they’d delivered it and given me an invoice. Implicit contracts like this can work well but they are more susceptible to errors or misunderstandings. Some implicit contracts are based on cultural understanding, and there may be times when things get confused or forgotten. In general, the more important something is, the more there is a need for an explicit instead of implicit contract...