Service Virtualization On The Cheap (Agile Testing Days 2016)

1f686da361195e15bb4e478397a4fc8f?s=47 emanuil
December 08, 2016

Service Virtualization On The Cheap (Agile Testing Days 2016)

Any sufficiently complex software application is talking to the outside world via HTTP to external services — for payments, data storage, social networks, IoT integration. Because of this, your high level automated tests have many more reasons to fail — the internet is slow, the external service throttle your requests or your credentials expire periodically.

This talk goes over the history of external service simulation and its role in creating reliable automated tests. It shows you how to start small (using internal triggers) and build your way up using open source tools for HTTP simulation.

At Komfo, we consume lots of advanced 3rd party APIs, and we hit the limits or the first generation tools pretty quickly. We had to develop our own tool — project Nagual to address today’s complex application needs for complete HTTP protocol simulation.

Nagual is written in node.js with speed and simplicity in mind. It has а number of distinct features not all present in any current tool: no code or database changes needed for the application under test, fully dynamic responses, local response storage for complex scenarios, transparent traffic routing, dynamic generation of SSL certificates to handle SSL verification of external services. It’s free, open source and can be found here: github.com/emanuil/nagual

1f686da361195e15bb4e478397a4fc8f?s=128

emanuil

December 08, 2016
Tweet

Transcript

  1. 3.
  2. 8.

    Pros Cons Uses real recorded data Refreshes automatically Returns only

    recorded data Framework specific Easy to setup for simple APIs Requires network
  3. 9.
  4. 10.
  5. 11.

    Pros Cons No need for network Access to internal app

    state Monolithic applications only Cheap to setup Do not cover low level code May cause havoc in production
  6. 15.

    Existing Tools (March 2016) Transparent Fake SSL certs Dynamic Responses

    Local Storage Return Binary Data Regex URL match Stubby4J WireMock Wilma soapUI MockServer mounteback Hoverfly Mirage
  7. 17.

    Written in Node.JS Pluggable architecture Optimized for speed Battle tested:

    Facebook, Twitter, Instagram It’s free, examples included
  8. 21.
  9. 23.

    POST /v2.2/12345678/comments { id: 99997777 } GET /v2.2/99997777 { id:

    99997777
 message: “my new comment” timestamp: 1481923013 more_fields: “yes” } {message: “my new comment”} Application (request) Facebook (response)
  10. 25.
  11. 27.
  12. 30.
  13. 31.
  14. 32.
  15. 33.
  16. 37.

    Nagual core is only 700 lines of code Modifying HTTP

    is easy in Node.JS Future out what features you need
  17. 40.