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

Testing serverless applications - BTC2018

Testing serverless applications - BTC2018

Slobodan Stojanović

November 10, 2018
Tweet

More Decks by Slobodan Stojanović

Other Decks in Programming

Transcript

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

    of Serverless Applications with Node.js book AWS Serverless Hero
  2. @slobodan_ Slobodan Stojanovic CTO @ Cloud Horizon and VacationTracker.io co-author

    of Serverless Applications with Node.js book AWS Serverless Hero @slobodan_ effortless-serverless.com
  3. @slobodan_ • 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…
  4. @slobodan_ You can run parts of your code locally to

    speed up the development, but not everything
  5. @slobodan_ • Jasmine • Mocha • Jest • any other

    popular tool For example, for Node.js you can use:
  6. @slobodan_ Integration tests are cheaper, but also more important, because

    common serverless app is split into many small pieces
  7. @slobodan_ 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
  8. @slobodan_ • hexagonal architecture • be smart • test integrations

    that you own • or test your code with a different adapter
  9. @slobodan_ Bonus: You can promote tested function to production, so

    QA tests the same function that will be in production
  10. @slobodan_ Units are smaller and easier to test, but deployment,

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

    • IOpipe • Dashbird • Thundra • and others
  12. @slobodan_ Serverless apps often heavily relies on front end, in

    those cases you need to track front end errors as well
  13. @slobodan_ • 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