Practical contract testing with Pact
Contract testing is an approach that addresses the challenges of large-scale integration and E2E testing in distributed systems. It is not a new technique, in fact, it has been around for several years now, but unfortunately there aren't many good introductions, examples and use cases that clearly show the added value of contract testing, and how it can help speed up integration testing.
This course is designed to change that. Through hours of videos, quizzes and hands-on programming exercises, you will learn everything you need to know about contract testing, Pact and the tools in the Pact ecosystem.
So, what can you expect from this course? Here's the course outline for you:
- The context for this course
- The current testing process and its challenges
- What is a contract?
- What is contract testing?
- How is contract testing different from other approaches to integration testing?
- How is contract testing different from schema validation?
- Where does contract testing fit into your testing strategy?
- Different approaches to contract testing
- Introducing Pact and the Pact ecosystem
- Introducing the Pact CI/CD implementation guide
- What goes into a consumer contract?
- Preparing your machine for the hands-on exercises
- Generating a consumer contract (Java)
- Generating a consumer contract (JavaScript / TypeScript)
- Defining provider states
- Using Pact matchers
- Dealing with optional fields
- Introducing the Pact Broker
- Publishing our contracts using the Pact CLI tools
- Publishing our contracts using the Pact Maven plugin
- Versioning our contracts
- Contract publication options
- Provider-side contract verification with Pact (Java)
- Provider-side contract verification with Pact (JavaScript / TypeScript)
- Contract verification options
- Generate and publish consumer contracts in your pipeline
- Verify contracts and publish verification results in your pipeline
- Using webhooks
- Dealing with pending pacts
- What does can-i-deploy do?
- Recording deployments
- Checking for compatibility
- Adding can-i-deploy to your PR pipeline
- Adding can-i-deploy to your deployment pipeline
- Going through a consumer-side change
- Going through a provider-side change
- Impact on teams and communication
- Dealing with public APIs
- Involving the whole team
- The bidirectional contract testing flow
- Tools to support bidirectional contract testing
- Generating and publishing consumer contracts (Java)
- Generating and publishing consumer contracts (JavaScript / TypeScript)
- Publishing provider contracts
- Adding bidirectional contract testing to your Continuous Integration pipeline
- The Pact plugin framework
- Writing and using Pact plugins
- Defining and using contract testing implementation metrics
- Additional resources
As you can see, there's something in there for everyone. The content for this course will be released incrementally during the remainder of the year, meaning that the full course is available in December of 2024.
Are you ready to learn about contract testing? Let's get started!
Your Instructor
Hey, my name is Bas Dijkstra, and I am an independent test automation consultant and trainer.
I have been active in the test automation field for some 18 years now, and have worked on software testing and automation solutions across a wide range of programming languages, frameworks and technology stacks.
I’ve delivered test automation training to dozens of companies and hundreds of conference attendees in the Netherlands as well as abroad, to excellent reviews.
You can find a complete overview of my professional life on my LinkedIn profile.
I’m also the developer of RestAssured.Net, a library that is meant to to make writing tests for HTTP APIs in C# a breeze.
I live in Amersfoort, The Netherlands, together with my wife and two sons. When I am not at work, I like to go outside for a run or a long bike ride, or to sit down and read a good book.
Course Curriculum
-
StartWhat is a contract? (2:03)
-
StartWhat is contract testing? (2:14)
-
StartHow is contract testing different from other approaches to integration testing? (3:18)
-
StartHow is contract testing different from schema validation? (3:03)
-
StartWhere does contract testing fit into your testing strategy? (2:50)
-
StartDifferent approaches to contract testing (5:05)
-
StartContract testing - Concepts - Quiz
-
StartContract testing - Concepts - Additional resources