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

Testing serverless apps @ Serverless CPH 2018

Testing serverless apps @ Serverless CPH 2018

Talk from Serverless CPH conference: https://serverlesscph.dk

Slobodan Stojanović

May 16, 2018
Tweet

More Decks by Slobodan Stojanović

Other Decks in Programming

Transcript

  1. @slobodan_ Slobodan Stojanovic CTO @ Cloud Horizon Claudia.js core team

    member co-author of Serverless Apps with Node and Claudia.js @slobodan_ effortless-serverless.com
  2. @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…
  3. @slobodan_ You can run parts of your code locally to

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

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

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

    that you own • or test your code with different adapter
  8. @slobodan_ You can promote test function to production, that way

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

    triggers and permissions are not trivial (but they are getting easier and easier)
  10. @slobodan_ Serverless apps often heavily relies on front end, in

    those cases you need to track front end errors as well
  11. @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
  12. @slobodan_ A few things that I mentioned in the talk:

    claudiajs.com desole.io vacationtrackerbot.com