Just-in-time testing To efficiently test and deliver your serverless applications, it is not enough to limit your test coverage; you must also limit the number of times those tests are run. Serverless and infrastructure as code make it possible and inexpensive to replicate your production environment. However, if a test passes in one non-production envi‐ […]
Category: Microsoft Certifications
Upholding Standards with a Definition of Done – Testing Serverless Applications
Upholding Standards with a Definition of Done You may have encountered different forms of a “definition of done” or seen various implementations of such a document. The Scrum.org Scrum Glossary defines this as: A formal description of the state of the Increment when it meets the quality measures required for the product. The moment a […]
Environments – Testing Serverless Applications
Environments The traditional approach to software testing involves the use of multiple pre-production, or staging, environments. A snapshot of the application is deployed to the first environment in the chain and then promoted to the next environment as soon as all the tests pass, until this version of the application finally reaches production. The common […]
Integration points testing checklist – Testing Serverless Applications
Integration points testing checklist For each integration point you should capture the failure modes for the categories listed in Table 7-1 and decide whether to cover them with tests. Table 7-1. Integration points testing checklist Remember not to couple decoupled components in your tests. Whenever possible, test the source and target of an integration point […]
Mocking – Testing Serverless Applications
Mocking Unit tests should be predictable. In other words, a unit test should produce the same result every time it is executed with the same input. Take the addNumbers method shown here: export const addNumbers = (numbers) => { return numbers.reduce((a, b) => { return a + b; }); }; export const handler = async […]
Testing integration configuration – Testing Serverless Applications
Testing integration configuration In our example architecture, you are responsible for the configuration of the custom EventBridge event bus and the EventBridge rule, which includes the event pattern and the target. Using an IaC framework such as the AWS Cloud Development Kit allows you to make assertions about the resources in the underlying CloudFormation template. […]
Testing integration payloads – Testing Serverless Applications
Testing integration payloads In the example architecture, you can test the payload sent to EventBridge by the event producer Lambda function by verifying it against a schema definition of the event. In JavaScript, you could use a JSON schema validation library, such as Ajv: import Ajv from “ajv”; import { generateOrder } from “./producer”; import […]
Hands-on Serverless Testing – Testing Serverless Applications
Hands-on Serverless Testing From the previous sections of this chapter, you should have started to form a mental model of how to approach testing a serverless application. Now it’s time to look at applying this model to an example architecture. Before testing any application, it is important to understand exactly what you are testing. As […]
Identifying the Units of Scale – Operating Serverless
Identifying the Units of Scale Most of the serverless managed services you will use in your architecture will provide automatic scaling and pay-per-use billing. This means you will be able to scale your application to respond to any level of demand while only paying for the resources you use, when you use them. For example, […]
Promoting Serverless Observability – Operating Serverless
Promoting Serverless Observability The primary goal of observability is to provide engineers with maximum visibility of their software. Observability is all about optimizing your software engineering practice with a view toward building observable systems—that is, systems that can be inspected and analyzed to understand their behavior, performance, and health. For a deep dive into observability, […]