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.
"A Pact book" would be probably a more adequate title as the book is solely focused on Pact. It's not the worst choice as Pact is both very popular and truly-battle-proven, but it's good to set the expectations straight.
TBH, "CTiA" felt a bit like it was written by Gen AI. An no, I'm not making accusations here - this impression is caused by the fact that the book feels very dry - like it was generated from Pact documentation ... It executes a reasonable plan, does it "ruthlessly" point by point, but unfortunately going mostly through "happy-path" scenarios.
It covers both popular approaches: consumer-driven and provider-driven. Additionally it goes beyond typical RESTful APIs and touches both GraphQL and event-driven approach. That all sounds awesome, but it feels like your tutored to repeat the tutorial ... Where's real-life in that? Where are challenges? What about patterns and anti-patterns? Common mistakes? Challenges of scaling? How to organize contract testing in various branching models / environment approaches? There's literally no guidance that I'd expect from real practitioners. If asked ChatGPT to create such a book, I believely I'd get something really similar.
Unfortunately, I can't honestly recommend this one. It's OK to go through the basics if it's a part of a subscription (in my case it was OReilly), but I wouldn't pay a full price for it ;/
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.