Book Review: Contract Testing in Action
Note: I read this book about 11-12 months ago and took a lot of notes on what I thought about the book during this time (in preparation for a book review). Only recently have I gotten back into blogging and decided to turn these opinions and thoughts into a blog post.
Target Audience
The book states it’s “written for developers and testers familiar with integration testing and ready to start their contract testing journey.” However, the copy text says it’s “for software developers and quality engineers who have worked with Java or JavaScript and APIs.”
There’s a bit of a mismatch here, but I think what it says in the book is more accurate.
I would recommend this book for developers and/or testers who have a solid understanding of integration testing and are looking into and/or about to start their contract testing journey.
With that said, even if you’re not familiar with integration testing, you can still benefit from the book - though having that background will definitely help you absorb the concepts more easily.
Note: I’m quite far from the target audience based on what my current role entails - but I went ahead and bought the book anyway. I wanted to still have a good grasp on what’s happening in our industry and know where/how our team needs to adapt to what’s happening.
What I Thought About the Book
To start off with, the first thing I appreciated about the book was the clear structure.
The book is split up into 3 parts:
- Introduction to Contract Testing
- Consumer-Driven Contract Testing
- Provider-Driven Contract Testing
The largest section is the Consumer-Driven Contract testing part, I believe this is because this is the most common type of contract testing you are likely to encounter/implement.
The book is full of useful, clear examples. For example (see what I did there!), they use a movies API throughout - great example that’s easy to understand and wrap your head around. There’s also a helpful table showing different business rules and what should be covered in a unit test vs what should be covered in a contract test.
The authors effectively used diagrams to illustrate concepts throughout the book. Alongside the examples and diagrams, they also utilized analogies to make complex ideas more accessible. That said, I think to reap the most benefits from this book, you need to have experience with integration testing.
Beyond the technical content, I appreciated that they addressed the cost-saving, quality and team benefits of contract testing. They also shared useful advice on introducing contract testing, referencing “Start With Why” by Simon Sinek. I think this advice can be applied not just to contract testing but anything new you want to introduce to the team when you’re wanting to implement some sort of change.
My favourite part of the book was the section focused on challenges. I liked the reality of this chapter where the authors acknowledged that there can be obstacles along the way - very pragmatic of them. They provided clear explanations as to why these obstacles can be challenging and how to overcome them. They also warned about the importance of getting buy-in from multiple teams about contract testing. If only one team is invested, contract testing won’t (can’t) succeed.
Reading Experience
I read this on the live book platform. Sometimes I found it a bit annoying because I wanted to quickly flip between sections to see the description/instructions from earlier pages. For me, a physical book would have been better.
