Serverless Testing - AWS Lambda
Let's start with what is Serverless Framework?
- It manages your code as well as your infrastructure
- It supports multiple languages (Node.js, Python, Java, and more)
While the Serverless Architecture introduces a lot of simplicity when it comes to serving business logic, some of its characteristics present challenges for testing. They are:
- The Serverless Architecture is an integration of separate, distributed services, which must be tested both independently, and together.
- The Serverless Architecture is dependent on internet/cloud services, which are hard to emulate locally.
- The Serverless Architecture can feature event-driven, asynchronous workflows, which are hard to emulate entirely.
To get through these challenges, and to keep the test pyramid in mind, keep the following principles in mind:
- Write your business logic so that it is separate from your FaaS provider (e.g., AWS Lambda), to keep it provider-independent, reusable and more easily testable.
- When your business logic is written separately from the FaaS provider, you can write traditional Unit Tests to ensure it is working properly.
- Write Integration Tests to verify integrations with other services are working correctly.
- Acceptance – does the whole system work?
- Integration – does our code work against code we can’t change?
- Unit – do our objects do the right thing, are they easy to work with?
- A Lambda function is ultimately a piece of code that AWS invokes on your behalf when some input event occurs. To test that it integrates correctly with downstream systems you can invoke the function from your chosen test framework
Source: http://theburningmonk.com/2017/02/yubls-road-to-serverless-architecture-part-2/
https://read.acloud.guru/testing-and-the-serverless-approach-495cef7495ea
https://martinfowler.com/articles/microservice-testing/
https://martinfowler.com/articles/serverless.html
https://aws.amazon.com/blogs/compute/serverless-testing-with-aws-lambda/
nice post! Thanks for delivering a good stuff related to DevOps, Explination is good, nice Article
ReplyDeleteanyone want to learn advance devops tools or devops online training
DevOps Online Training
DevOps Training institute in Ameerpet
This comment has been removed by the author.
ReplyDeleteNice Blog very use full inormation.AWS-certified experts help you develop a cloud strategy which aligns with your business transformation road map and implement cloud management solutions to harness the AWS Cloud Managed Services
ReplyDeleteNice post. Keep updating AWS Online Training
ReplyDeleteI really liked your blog post.Much thanks again. Awesome.
ReplyDeleteaws training
r programming training