Lightening Talk for the Auckland Continuous Delivery Meetup spreading the message that 'Integrated Tests Are A Scam', providing a journey to where we are and a focus on Pact as a tool to solve service 'integration' testing using Consumer-Driven Contracts.
4. Integrated Tests Are A Scam
Integrated tests are a scam—a self-replicating
Commercial in Confidence | Assurity Consulting Limited 2014
virus that threatens to infect
your code base, your project, and your
team with endless pain and suffering.
11. Consumer-Driven Contract Benefits
…they focus the specification
and delivery of service
functionality around key
business value drivers.
Commercial in Confidence | Assurity Consulting Limited 2014
…give us the fine-grained
insight and rapid feedback we
require to plan changes and
assess their impact on
applications currently in
production
Consumer-Driven Contracts, A Service Evolution Pattern: Ian Robinson
17. Why Are Integrated Tests A Scam?
Commercial in Confidence | Assurity Consulting Limited 2014
Integrated Tests Are A Scam (2010): J.B. Rainsberger
18. Why Are Integrated Tests A Scam…
Consider 10 layers with 3
potential branch points
at each layer. Number of
code paths: 310 > 59,000.
How about 4 branch
points per layer? 410 >
1,000,000. How about 3
branch and 12 layers?
312 > 530,000.
Commercial in Confidence | Assurity Consulting Limited 2014
How about 3 branch and
12 layers? 312 > 530,000.
Even if one of your 12
layers has a single code
path, 311 > 177,000.
Even if your 10-layer
application has only an
average of 3.5 code
paths per layer, 3.510>
275,0001.
Do you feel lucky?
Do you?
Integrated Tests Are A Scam (2010): J.B. Rainsberger
19. How to beat the Scam…
Commercial in Confidence | Assurity Consulting Limited 2014
Integrated Tests Are A Scam (2010): J.B. Rainsberger
21. Sharing Tests!! …
To reduce the chances of unexpected
breaks in integration contracts, it's useful
to move to a Consumer Driven
Contracts approach. You can facilitate this
by letting the supplier team have copies of
your integration contract tests so they can
run them as part of their build pipeline.
Commercial in Confidence | Assurity Consulting Limited 2014
Integrtation Contract Tests (2010): Martin Fowler
26. Pact
Commercial in Confidence | Assurity Consulting Limited 2014
Testing Interactions with Web Services without Integration Tests In Ruby:
REA Engineering Blog
27. Pact
Consumer sets up
expectations on a mock
service provider. Mock
service returns the
expected responses.
The requests, and their
expected responses, are
then written to a "pact“
file
Commercial in Confidence | Assurity Consulting Limited 2014
The requests in the pact
file are later replayed
against the provider. Actual
responses are checked to
make sure they match the
expected responses.
Integrated Tests Are A Scam (2010):
J.B. Rainsberger
28. Pact
Commercial in Confidence | Assurity Consulting Limited 2014
Testing with Pact: Pact Wiki
29. Pact
Commercial in Confidence | Assurity Consulting Limited 2014
Simplifying Micro-Services Testing with Pacts: Ron Holshausen
30. Pact Features
Pact Wiki
Commercial in Confidence | Assurity Consulting Limited 2014
31. Pact
We now have fast unit-like
tests on each side of the
integration point instead of
tedious integration tests.
Commercial in Confidence | Assurity Consulting Limited 2014
Testing Interactions with Web Services without Integration Tests In Ruby:
REA Engineering Blog
33. Why Integration Test Are Still A Scam…
Commercial in Confidence | Assurity Consulting Limited 2014
Cumulative
# Required;
Slow &
Brittle
Doesn’t
Provide
Coverage
Expected
Encourage
Sloppy
Coding
Integrated Tests Are A Scam
35. Trial Pact & Pacto
Consumer-Driven Contracts are a testing
approach to help service interfaces evolve
with confidence without unknowingly
breaking consumers. The similarly
named Pact and Pacto are two new open-source
tools which allow testing interactions
between service providers and consumers in
isolation against a contract. Both have grown
out of projects which are building RESTful
microservices and show great promise.
Commercial in Confidence | Assurity Consulting Limited 2014
ThoughtWorks Technology Radar: July 2014