nerdexam
Amazon

DOP-C02 · Question #207

A software team is using AWS CodePipeline to automate its Java application release pipeline. The pipeline consists of a source stage, then a build stage, and then a deploy stage. Each stage contains…

The correct answer is B. Modify the build stage. Add a test action that has a runOrder value of 2. Use AWS CodeBuild as. Explanation Option B is correct because adding a test action with a runOrder of 2 in the build stage ensures unit tests run after the build completes (runOrder 1) but before deployment - meaning only code that passes all tests will proceed to the deploy stage, satisfying the…

Submitted by andres_qro· Mar 6, 2026SDLC Automation

Question

A software team is using AWS CodePipeline to automate its Java application release pipeline. The pipeline consists of a source stage, then a build stage, and then a deploy stage. Each stage contains a single action that has a runOrder value of 1. The team wants to integrate unit tests into the existing release pipeline. The team needs a solution that deploys only the code changes that pass all unit tests. Which solution will meet these requirements?

Options

  • AModify the build stage. Add a test action that has a runOrder value of 1. Use AWS CodeDeploy
  • BModify the build stage. Add a test action that has a runOrder value of 2. Use AWS CodeBuild as
  • CModify the deploy stage. Add a test action that has a runOrder value of 1. Use AWS CodeDeploy
  • DModify the deploy stage. Add a test action that has a runOrder value of 2. Use AWS CodeBuild as

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    81% (22)
  • C
    4% (1)
  • D
    11% (3)

Explanation

Explanation

Option B is correct because adding a test action with a runOrder of 2 in the build stage ensures unit tests run after the build completes (runOrder 1) but before deployment - meaning only code that passes all tests will proceed to the deploy stage, satisfying the requirement perfectly. AWS CodeBuild is the appropriate service here, as it is designed to compile code, run tests, and produce artifacts within a pipeline.

Why the distractors are wrong:

  • Option A is incorrect because a runOrder of 1 would run the test action in parallel with the build action, not after it - tests cannot run before the code is compiled.
  • Option C is incorrect because placing the test action in the deploy stage with runOrder 1 uses CodeDeploy (a deployment service, not a testing service) and tests would run alongside deployment rather than preventing a bad deployment.
  • Option D is incorrect because adding a test action in the deploy stage - even with runOrder 2 - means deployment begins before all tests have passed, violating the requirement to deploy only passing code.

Memory Tip: Think of runOrder like a sequence of steps on an assembly line - higher numbers happen later. Tests must happen after building (runOrder 1 → 2) but before deploying, so always place your test action in the build stage with runOrder 2.

Topics

#AWS CodePipeline#AWS CodeBuild#CI/CD#Unit Testing

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice