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

Service Virtualization On The Cheap (Agile Testing Days 2016)

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


December 08, 2016

More Decks by emanuil

Other Decks in Programming


  1. Pros Cons Uses real recorded data Refreshes automatically Returns only

    recorded data Framework specific Easy to setup for simple APIs Requires network
  2. 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
  3. 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
  4. Written in Node.JS Pluggable architecture Optimized for speed Battle tested:

    Facebook, Twitter, Instagram It’s free, examples included
  5. POST /v2.2/12345678/comments { id: 99997777 } GET /v2.2/99997777 { id:

 message: “my new comment” timestamp: 1481923013 more_fields: “yes” } {message: “my new comment”} Application (request) Facebook (response)
  6. Nagual core is only 700 lines of code Modifying HTTP

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