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

Testing Serverless Applications - TestBusters-N...

Testing Serverless Applications - TestBusters-Night Vienna

Slobodan Stojanović

September 06, 2018
Tweet

More Decks by Slobodan Stojanović

Other Decks in Programming

Transcript

  1. Slobodan Stojanovic CTO @ Cloud Horizon and VacationTracker.io co-author of

    Serverless Applications with Node.js book AWS Serverless Hero @slobodan_ effortless-serverless.com
  2. • Azure Functions Core Tools (for Azure functions) • AWS

    SAM CLI (for AWS SAM) • third-party tools (ie. localstack) • docker-lambda for AWS Lambda local simulation • run Node.js function locally • and more…
  3. You can run parts of your code locally to speed

    up the development, but not everything
  4. • Jasmine • Mocha • Jest • any other popular

    tool For example, for Node.js you can use:
  5. Integration tests are cheaper, but also more important, because common

    serverless app is split into many small pieces
  6. Allow an application to equally be driven by users, programs,

    automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases. Alistair Cockburn
  7. • hexagonal architecture • be smart • test integrations that

    you own • or test your code with a different adapter
  8. Bonus: You can promote tested function to production, so QA

    tests the same function that will be in production
  9. Units are smaller and easier to test, but deployment, triggers

    and permissions are not trivial (but they are getting easier and easier)
  10. • Built-in tools (CloudWatch, X-Ray for AWS) • Epsagon •

    IOpipe • Dashbird • Thundra • and others
  11. Serverless apps often heavily relies on front end, in those

    cases you need to track front end errors as well
  12. • you can run/test some parts of serverless app locally

    • automated tests are important, but be smart • use hexagonal architecture to stay flexible • use CI/CD for tests and deployment to different stages • QA can test the same function you are deploying to production • use mature and tested deployment tools, and track and analyze errors