Question 917 of 724
DVA-C02 Development with AWS Services Practice Question
A developer is using AWS CodePipeline to automate the deployment of a web application. The developer wants to run unit tests after the source stage and before deploying to a staging environment. Which action should the developer add to the pipeline?
⚠ Common exam trap
Watch out — candidates often confuse CodeDeploy as the service for running tests because it handles deployments, but CodeDeploy does not execute build or test commands; it only deploys pre-built artifacts.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
AWS CodeBuild
AWS CodeBuild is the correct service to run unit tests in a CodePipeline because it provides a fully managed build environment that can execute test commands defined in a buildspec file. By adding a CodeBuild action to the pipeline after the source stage, the developer can run unit tests and fail the pipeline if tests do not pass, ensuring only validated code proceeds to the staging deployment.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
AWS CodeBuild
Why this is correct
AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces deployable artifacts. Within an AWS CodePipeline, CodeBuild is typically configured as a build or test stage, executing unit tests, integration tests, or even security scans defined in a `buildspec.yml` file. This ensures that code quality and functionality are validated thoroughly before the application proceeds to subsequent deployment stages, making it the correct choice for automating the testing phase.
- ✗
AWS CodeCommit
Why it's wrong here
AWS CodeCommit is a secure, highly scalable, and fully managed source control service that hosts private Git repositories. Its primary function is to store and manage source code, binaries, and other development assets, providing robust version control and collaboration features for development teams. While CodeCommit serves as the initial source stage for a CodePipeline, it does not possess any capabilities to execute tests or build processes on the stored code itself.
- ✗
AWS CloudFormation
Why it's wrong here
AWS CloudFormation is an infrastructure as code (IaC) service that enables developers to define and provision AWS infrastructure resources in a declarative manner using templates. It automates the creation, update, and deletion of AWS resources, ensuring consistent and repeatable environment setups. CloudFormation's role is to manage the underlying infrastructure for applications, such as EC2 instances or databases, rather than to execute application-level tests or perform code compilation.
- ✗
AWS CodeDeploy
Why it's wrong here
AWS CodeDeploy is a fully managed deployment service that automates software deployments to various compute services, including Amazon EC2, AWS Fargate, AWS Lambda, and on-premises servers. Its core purpose is to reliably and consistently release application revisions to target environments. Although CodeDeploy can incorporate lifecycle hooks for validation *during* a deployment, it is not designed to run comprehensive pre-deployment unit or integration tests on the application code itself, which is a distinct build and test phase.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jul 4, 2026
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.