Contract Testing in Action is a hands-on guide to contract testing for microservices applications and other systems of loosely-coupled components. After learning the basics of contract design and implementation, you’ll dive into constructing your own contract testing framework. You’ll explore the leading contract testing tools, including Pact, Pactflow, and GitHub Actions. Plus, you’ll set up consumer-driven contract testing for REST and GraphQL APIs and learn to integrate contract testing into a CI/CD pipeline. Finally, you’ll delve into provider-driven contract testing, which simplifies adoption by utilizing your existing stack and practices.
An excellent book on contract testing with Pact by Marie Cruz and Lewis Prescott.
Why should you read this book? - The book contains a detailed explanation of the idea of contract testing and how it fits in the current levels of testing - The book has a bunch of examples on how to implement different approaches (consumer-driven and producer-driven) in different project contexts - Web, Mobile, GraphQL, Event-based apps, etc. - The book is highly practical and contains exercises for self-assessment
I can recommend this book to any software engineer or test engineer who wants to understand what contract testing is and how to implement it on a project!
This was my first read of the first 109 pages that are in MEAP so far and although the code is JS-based and utilizes PactFlow it is a pretty good primer for the whole idea.
I especially like the strong focus to replace Integration Testing with the combination of Contrat and Unit Testing.
This is a must-read for those who know as well as want to know about contract testing. The book first helps sell the concept of contract testing by explaining various aspects of it and then digs deeper into details with PACT framework.