1 Introduction

 

This chapter covers

  • What this book is about and why it’s important
  • A high-level overview of what contract testing is
  • Why you should care about contract testing
  • When contract testing is appropriate to use and not use
  • How contract testing works on a high-level
  • Contract testing in action

Imagine this scenario. It’s 4 p.m. on a Friday, and you decided to deploy a small change of updating one of your API’s data responses. All the automated tests from your pipeline are returning green, which gives you the confidence that you haven’t broken anything. You hit deploy, and a few minutes after the deployment, you get a message from another team that something is broken in production. It couldn’t be the change you recently deployed, because it was a small change, and all the tests are passing... right? As it turns out, this other team using your API has certain expectations. During the incident, you’ve learned that this other team has different expectations from yours. Rather than enjoying your Friday afternoon, you’re left with a production bug you must deal with.

1.1 An overview of what contract testing is

 
 
 

1.2 Why contract testing matters

 

1.3 When is contract testing appropriate to use and not use?

 
 

1.4 How contract testing works on a high-level

 

1.4.1 Contract testing from the consumer side

 

1.4.2 Contract testing from the provider side

 
 

1.5 Contract testing in action

 
 
 

1.5.1 Example of a consumer contract test

 

1.5.2 Example of a provider contract test

 
 

1.6 Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest