Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SOA Working Group Meeting #4

Darby Frey
September 30, 2015

SOA Working Group Meeting #4

Darby Frey

September 30, 2015
Tweet

More Decks by Darby Frey

Other Decks in Technology

Transcript

  1. SOA Working Group Meeting #3 - Agenda Darby Frey (Belly)

    - Testing with Microservices Nathan Keyes (Avant) - Philotic Anthony Broad-Crawford (Fooda) - Rust(y) SOA
  2. Unit Tests • Fast Feedback • Isolated • Good for

    Refactoring • Technology Facing • Provide little confidence around the system as a whole
  3. Service Tests • Fast Feedback • Some Exposure to Dependencies

    • Stub Downstream Services • Stubs are hard to maintain (VCR, Mountebank, etc.) • Primarily Technology Facing • Easy to get out of sync with downstream changes • Provide slightly more confidence around the system as a whole
  4. End to End Tests • Provide high confidence around the

    system as a whole • Business Facing • Hard to setup and maintain • Slow Feedback • Can be Brittle • Who is responsible in the event of a failure? • Core Journeys • Jointly Owned
  5. Example - Consumer Zoo App ...setup... animal_service.given("there is an alligator

    named Mary"). upon_receiving("a request for an alligator").with( method: :get, path: '/alligators/Mary', headers: {'Accept' => 'application/json'} ). will_respond_with( status: 200, headers: {'Content-Type' => 'application/json;charset=utf-8'}, body: {name: 'Mary'} )
  6. Example - Pact File { "provider": { "name": "Animal Service"

    }, "consumer": { "name": "Zoo App" }, "interactions": [ … ] "metadata": { "pactSpecificationVersion": "1.0.0" } }
  7. Example - Pact File (interaction) { "description": "a request for

    an alligator", "provider_state": "there is an alligator named Mary", "request": { "method": "get", "path": "/alligators/Mary", "headers": { "Accept": "application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/json;charset=utf-8" }, "body": { "name": "Mary" } } },
  8. Example - Provider Animal Service ...setup... honours_pact_with "Zoo App" do

    pact_uri '../zoo-app/spec/pacts/zoo_app-animal_service.json' end
  9. Consumer Driven Tests • https://github.com/realestate-com-au/pact • https://github.com/bethesque/pact_broker • http://www.infoq.com/presentations/pact •

    Faster Feedback (than End to End Tests) • Higher Confidence (than Unit Tests) • Easier to Maintain (than Service Tests) • Setup is Time Consuming • Pact Broker is an External Dependency
  10. No Silver Bullet • Canary Releases, Smoke Tests, Semantic Monitoring

    • Time to Repair vs. Time Between Failures • Optimize for Fast Feedback