David Van Couvering (DVC) - eBay
04/05/2022, 9:30 PMBoris
04/05/2022, 11:23 PMBoris
04/05/2022, 11:24 PMBoris
04/05/2022, 11:25 PMBeth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 5:49 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 5:50 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 5:51 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 5:54 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 5:55 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 5:55 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 5:56 PMIf the refactoring burden is genuinely huge, I also wonder if the balance of coverage is wrong.
Beth (pactflow.io/Pact Broker/pact-ruby)
And as I have been thinking about this more, if you have a huge contract that is difficult to maintain, the underlying problem is actually that the API (and likely the underlying service) is poorly designed - a big surface area indicates a service that has poor cohesion and likely high coupling.That is such a valid point. When tests are hard it's sending you a message that using it is likely also hard.
Beth (pactflow.io/Pact Broker/pact-ruby)
This code could also be used to publish an initial contract that is likely way too strict and brittle,Yes, it's very easy to make overly specific pacts. I rant about this at great length in some of my "how to do the consumer side" materials. eg. https://docs.pact.io/consumer#only-make-assertions-about-things-that-will-affect-the-consumer-if-they-change https://docs.pact.io/consumer#choose-the-right-type-of-matching-for-the-situation and the video in https://docs.pact.io/consumer#watch-a-video-writing-good-consumer-tests
Beth (pactflow.io/Pact Broker/pact-ruby)
I am working on a tool that can listen to live traffic, record the interactions, and then generate a starting set of expected interactions code. You can then go in and tweak the code, rather than having to write it all by hand.
Does that sound useful/interesting?Yes - we've long talked about being able to generate pact tests from a set of interactions, but we've always had too many other things to do first. The key is that we want to generate test code, not the contract itself. I'm not 100% certain how much "wheat" will come out of such a generation, and how much "chaff" though. It's absolutely worth the experiment though, and would be such a big help introducing contract testing to large existing systems if it ended up working as we'd hope.
David Van Couvering (DVC) - eBay
04/07/2022, 10:48 PMBeth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 11:01 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 11:01 PMBeth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 11:02 PMBeth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 11:04 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 11:06 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 11:06 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
David Van Couvering (DVC) - eBay
04/07/2022, 11:08 PMDavid Van Couvering (DVC) - eBay
04/07/2022, 11:08 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Boris
04/08/2022, 1:33 AMI wasn't sure what you meant by this can you explain? What is "balance of coverage" in this context?
> If the refactoring burden is genuinely huge, I also wonder if the balance of coverage is wrong.You've both kinda covered it with "contract that is likely way too strict and brittle" and "Yes, it's very easy to make overly specific pacts". Sometimes people push too much stuff into Pact (so some testing should move to other areas of the pyramid), or have too many specific interactions that could be generalised a bit.
David Van Couvering (DVC) - eBay
04/08/2022, 2:07 AM