Search⌘ K
AI Features

Testing and Deployment III

Explore testing and deployment scenarios relevant to the AWS Certified Developer – Associate exam. Understand proper unit test assertions for AWS Lambda, best practices for pushing Docker images to Amazon ECR, JVM memory configuration on Elastic Beanstalk, and correct API usage with Amazon Bedrock. This lesson helps you apply practical solutions to common development and deployment challenges in AWS environments.

Question 50

A developer used an AI coding tool to generate a unit-test suite for an AWS Lambda handler that writes orders to an Amazon DynamoDB table. The AWS CodeBuild coverage report shows 95 percent line coverage, and every test passes. On review, each test only calls the handler and checks that no exception was raised.

What is the problem with this suite, and what should the developer do?

A. There is no problem, because 95 percent line coverage proves that the handler’s behavior is tested. Merge the suite and fail the build if coverage drops below 95 percent.

B. Coverage shows only which lines the tests ran, not that the tests check anything. Add assertions on the handler’s outputs or side effects, and confirm that at least one test fails when a condition in the function is changed on purpose.

C. The tests use mocks instead of the real DynamoDB table. Point the unit tests at the production table so that the results reflect real behavior. ...