AWS Certified Developer – Associate (DVA-C02) — Question 62
A developer is using AWS Amplify Hosting to build and deploy an application. The developer is receiving an increased number of bug reports from users. The developer wants to add end-to-end testing to the application to eliminate as many bugs as possible before the bugs reach production.
Which solution should the developer implement to meet these requirements?
Answer options
- A. Run the amplify add test command in the Amplify CLI.
- B. Create unit tests in the application. Deploy the unit tests by using the amplify push command in the Amplify CLI.
- C. Add a test phase to the amplify.yml build settings for the application.
- D. Add a test phase to the aws-exports.js file for the application.
Correct answer: C
Explanation
The correct answer is C because adding a test phase to the amplify.yml build settings allows for automated end-to-end testing during the build process, helping to catch bugs before deployment. Option A is incorrect as the amplify add test command does not exist in the Amplify CLI. Option B focuses on unit tests rather than end-to-end tests, which do not fulfill the requirement. Option D is also incorrect because aws-exports.js is used for configuration and not for defining test phases.