Integration testing a cloud-native application with JavaScript

By Markus Tacker

Elevator Pitch

In this talk I will take you through the challenge of testing a cloud-native application. I will cover the challenges when developing solutions on top of serverless components which you cannot run on your own machine and how I designed a BDD driven approach to run the integration tests.

Description

In this talk I will take you through the challenge of testing a cloud-native application that uses MQTT (a pub/sub protocol), webhooks and REST to interact with IoT devices on top of AWS. It uses services which cannot be run on a developers machine for testing, so I needed to develop a test setup which enables us to continuously test against real services. On top of that I wanted to use a BDD approach to write the tests to make our progress in the project self-documenting and the test immune against effects of big refactorings, which provides an extra set of challenges since these tests are written in a serial manner, which does not fit the async execution of the real solution. I’ll show how all this is done using JavaScript and that this is is not only an interesting challenge but uses tests that behave like real users, and that there is an Ops person in all of us.

The key takeaways in this talk are:

  • how the cloud native test-pyramid looks like
  • Infrastructure as code is key, because configuration of cloud-native services are part of the solution
  • how BDD can be used to write re-usable test instructions
  • to write tests that behave like real users (retry if failed multiple times) instead of programming shortcuts, because this will give better information to system design
  • use “real” test doubles backed by queues to monitor outcome of test cases

Notes

In my current project at Nordic Semiconductor I am building a RESTful API for interacting with the next generation of IoT devices. This solution is build on top of AWS using serverless components. Not only the implementation of the business logic is done in JavaScript, but I have developed the entire CI/CD solution in JavaScript. In this talk I will cover the challenges when developing solutions on top of serverless components which you cannot run on your own machine and how I designed a BDD driven approach to run the integration tests, because I absolutely love tests. It showcases that JavaScript can be used in a truly full stack manner today and that we can cover Development, DevOps and Testing with the one language we love. I am also really passionate about showcasing the BDD approach to testing which is in my opinion a fantastic way to drive test and at the same time have a living documentation.

Learn about CD/CI for cloud-native projects, how to test async projects with sync test definitions, learn about benefits of BDD/Gherkin, how to test cloud-only services.