Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Consumer driven contract testing with Pact (at the European Testing Conference 2020)

65 views

Published on

Did you ever struggle consuming an API that kept on changing? Did you provide an API that you were unsure how people will use it? In such a scenario, an iterative and cooperative way of working that focuses on consumer driven contract testing can reduce your pain. In other words, an experience with “Consumer collaboration over contract negotiation”.

This talk aims to practically illustrate consumer driven testing using Pact. We will cover when this technique is appropriate and how to organise, define and evolve APIs while keeping in mind. The session will involve a mixture of presentation and live coding to illustrate on how this works in practice.

https://europeantestingconference.eu/2020/topics/#matteo-pierro
Talk with https://twitter.com/matteo_pierro

Published in: Software
  • Be the first to comment

Consumer driven contract testing with Pact (at the European Testing Conference 2020)

  1. 1. CONSUMER DRIVEN CONTRACT TESTING WITH PACT The evolution of your APIs supporting with tests @nelisboucke @matteo_pierro
  2. 2. Overview ● Why? ● What is Contract Testing? ● Code example with Pact ● Challenges
  3. 3. Overview ● Why? ● What is Contract Testing? ● Code example with Pact ● Challenges
  4. 4. A STORY…
  5. 5. A STORY…
  6. 6. NOT COVERED BY TESTS? Trustworthy Cheap TargetedReliable
  7. 7. Integration tests Use running system Use mocks Reliability - + Speed - + Targeted - + Environment setup - not needed Test data - + Easy to automate - + Trustworthy + -
  8. 8. IF ONLY WE COULD VERIFY THE MOBILE TEAM'S MOCKS ……..
  9. 9. Overview ● Why? ● What is Contract Testing? ● Code example with Pact ● Challenges
  10. 10. Contract Testing flow →
  11. 11. Overview ● Why? ● What is Contract Testing? ● Code example with Pact ● Challenges
  12. 12. E-commerce →
  13. 13. Code Example →
  14. 14. Overview ● Why? ● What is Contract Testing? ● Code example with Pact ● Challenges
  15. 15. Challenge: collaboration? PACT does not solve your collaboration problems ● Provider must verify consumers’ expectations ● Consumer must check expectations with the provider
  16. 16. Challenge: Rework? PACT replaces your previous mocks ● Rework / Extend consumer tests to for this
  17. 17. Challenge: When Applicability? ● You want to integrate fast ○ Evolving application ○ Fast feedback ○ Reduce integration risk ● Limited and known consumers ○ Typical settings ■ Single organisation, multiple teams ■ Frontend backend ■ Microservices
  18. 18. @matteo_pierro@nelisboucke Questions?

×