9
Contract Testing the Mobile Boundary Stephen Vance and Dylan Spencer Zipcar Copyright Stephen Vance, 2016 Contract Testing the Mobile Boundary 1

Contract Testing the Mobile Boundary

Embed Size (px)

Citation preview

Page 1: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 1

Contract Testing the Mobile Boundary

Stephen Vance and Dylan SpencerZipcar

Copyright Stephen Vance, 2016

Page 2: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 2

Our System

Service Client(Consumer)

Service Implementation

(Provider)

Copyright Stephen Vance, 2016

Page 3: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 3

The Problem

Service Client(Consumer)

ClientTest Mock

Service Implementation

(Provider)

ServiceTest

?

Copyright Stephen Vance, 2016

Page 4: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 4

Contract Tests

Service Client(Consumer)

ClientTest

Service Implementation

(Provider)

Contract Tests

Copyright Stephen Vance, 2016

Page 5: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 5

Enter Pact

• Consumer driven contract testing

• https://github.com/realestate-com-au/pact

• Implementations– Ruby– JVM– .Net– JavaScript– Swift– Python From https://github.com/realestate-com-au/pact

Copyright Stephen Vance, 2016

Page 6: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 6

Pact Broker

Service Client(Consumer)

ClientTest

Contract Tests

Service Implementation

(Provider)

PactBroker

Copyright Stephen Vance, 2016

Page 7: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 7

Hungry for More?

• Martin Fowler on Contract Testing– http://

martinfowler.com/articles/consumerDrivenContracts.html

• Pact– https://github.com/realestate-com-au/pact

• Pact Broker– https://github.com/bethesque/pact_broker

• Twitter: @pact_upCopyright Stephen Vance, 2016

Page 8: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 8

Complementary Methods

• VCR– https://github.com/vcr/vcr– Records server interactions for verification against clients

• Webmock– https://github.com/bblimke/webmock– In-process stubbing for Ruby only

• Pacto– https://github.com/thoughtworks/pacto– Static contracts for Ruby only

• And More!

Copyright Stephen Vance, 2016

Page 9: Contract Testing the Mobile Boundary

Contract Testing the Mobile Boundary 9

Contact Me

Stephen Vancewww.vance.com

[email protected]@zipcar.com@StephenRVance

https://www.linkedin.com/in/srvance

Copyright Stephen Vance, 2016