Let’s Get Certified
Module 09 / 13 · Testing and deployment

Test the boundary that can fail

Distinguish local logic tests, API contracts and cloud integration tests with isolated resources.

Test the boundary that can fail

Use a small deterministic fixture for pure transformations. Test an event’s actual envelope, optional fields and failure cases. A mock API can return chosen statuses, timeouts and malformed responses, helping test retry and validation behavior. A mock cannot establish that the real execution role, service integration and network path work in the target environment.

Use an isolated stack, alias or test stage when verifying real integrations. Give the fixture a unique suffix and define cleanup. If AI generates tests, supply an independently derived expectation, including boundary values and failure outcomes. Coverage counts lines executed and can rise even when assertions fail to check the business rule.

Worked case

All local invoice tests pass, but the deployed test function cannot publish its event. Which next test would distinguish a role issue from a serialization bug?

Check your reasoning

Run a bounded integration test in the isolated environment with the deployment role, known payload and intended destination. Capture validation and authorization results separately.

Second worked case

A local test confirms a malformed payment was rejected. How would you ensure an unrelated valid payment still succeeds?

Check your reasoning

Include a representative valid fixture with an independently calculated expected result. Distinguish invalid inputs from valid edge cases. Keep each integration fixture isolated so a previous run cannot make the test pass.

Testing serverless applications · Official DVA-C03 objectives for this domain

Related lesson in GitHub Copilot. Verify tests, refactors and performance claims.

Checking an integration at three levels

Start with an API Gateway mock integration that returns a known error, then send a representative JSON event to a SAM local handler. Finally deploy an isolated stage and repeat the request using the real authorizer, service role and network path. Record which defects can pass each earlier check.

Practice with the recording

A serverless integration test passes once, then fails on every rerun because yesterday’s order already exists. How do you keep the test repeatable?

Check your reasoning

Create isolated test fixtures with a per-run namespace, capture the generated identifiers and clean up only that run’s resources. Make a separate idempotency test reuse the same business identifier intentionally. This keeps fixture collisions from masquerading as application failures.

Cert Espresso · DVA-C03 full course · 2:22:07

Apply the current exam objectives

Ask a coding assistant for edge cases after defining the expected outcomes independently. Include duplicate messages, partial failures and a call from the wrong tenant. Reject tests that merely mirror the implementation or that require production credentials.

Practice the individual exam skills
  • 3.2.1–3.2.5 Use a JSON event, an API mock and a deployed integration as three different tests. Give the run its own alias, image tag or stage. Ask an assistant for one missing failure case, then prove that its assertion fails on an incorrect implementation.
Knowledge check

Test the boundary that can fail quiz

Answer 3 questions. Check each answer for an explanation.

Worked example · Testing a deployed identity