Contract Testing in Action
eBook - ePub

Contract Testing in Action

With Pact, PactFlow, and GitHub Actions

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Contract Testing in Action

With Pact, PactFlow, and GitHub Actions

About this book

Contract testing is a simple, reliable way to make sure that each service and API plays nice with other components so you can deploy independently and safely.

Large, loosely coupled systems have hundreds, even thousands, of interactions—and traditional testing can often struggle to keep up! Enter contract testing. This rapidly growing new approach checks API and service compatibility by verifying it against an agreed contract. No more unexpected integration issues, and no more breaking things in production!

In Contract Testing in Action you’ll learn:

• The core concepts and practices of contract testing
• Testing microservices with Pact
• Consumer-driven and bi-directional testing
• Building a contract testing framework
• Converting API integration tests to contract tests

Contract Testing in Action introduces the practice of contract testing through engaging hands-on examples. You’ll learn how to introduce contract tests for multiple different types of communication, from REST APIs to event-driven architecture. By the end of this practical guide, you’ll be comfortable with advanced contract testing concepts like can-i-deploy, provider states, and webhooks. You’ll even get tips on how to introduce contract testing to your team and other business stakeholders.

About the technology

It’s difficult to test API and event-based services that can be used by many applications simultaneously through a complex network of integrations. Contract testing offers a straightforward solution. API and service compatibility are verified against agreed-upon contracts that each component in the system—and the developers that build them—can understand and respect. This transformative technique helps uncover integration issues early and adds vital transparency to any system.

About the book

Contract Testing in Action makes it easy for your team to adopt contract testing for microservices and other API-centric systems. You’ll start by learning how contract testing fits into the software development lifecycle, and then you’ll explore practical methods to integrate it with your own tech stack and practices. You’ll use leading contract testing tools—including Pact, PactFlow, and GitHub Actions—to build your own contract testing framework, set up consumer-driven contract testing for REST and GraphQL APIs, and integrate it into your CI/CD pipeline.

What's inside

• Testing microservices with Pact
• Consumer-driven and bi-directional contract testing
• Building a contract testing framework
• Converting API integration tests to contract tests

About the reader

For software developers and quality engineers who have worked with Java or JavaScript, and APIs.

About the author

Marie Cruz is a Software Tester with over ten years of experience and also a Developer Advocate at Grafana Labs. Lewis Prescott is a Test Specialist at IBM with over nine years experience in software testing.

Trusted by 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Publisher
Manning
Year
2025
eBook ISBN
9781638356608

Table of contents

  1. Contract Testing in Action
  2. copyright
  3. contents
  4. foreword
  5. preface
  6. acknowledgments
  7. about this book
  8. about the authors
  9. about the cover illustration
  10. Part 1 Introduction to contract testing
  11. 1 Introduction to contract testing
  12. 2 How contract testing fits into wider testing concepts
  13. 3 A technical overview of contract testing
  14. Part 2 Consumer-driven contract testing
  15. 4 Implementing consumer-driven contract testing for web applications
  16. 5 Implementing consumer-driven contract testing for mobile clients
  17. 6 Implementing consumer-driven provider contract tests
  18. 7 Contract testing for GraphQL
  19. 8 Contract testing for event-driven architecture
  20. 9 Storing, hosting, and securing the contracts
  21. 10 Setting up contract testing in a CI/CD pipeline
  22. Part 3 Provider-driven contract testing
  23. 11 Implementing provider-driven contract testing
  24. 12 Moving integration tests to contract tests
  25. appendix A Tool comparisons
  26. appendix B Setting up project requirements for consumer contract testing (web applications)
  27. appendix C Answers to chapter exercises
  28. index

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Contract Testing in Action by Marie Cruz,Lewis Prescott in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Java. We have over one million books available in our catalogue for you to explore.