13

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 ...

Get API Testing and Development with Postman - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.