DOP-C02 SDLC Automation Practice Question
A DevOps team wants to run unit tests in parallel across multiple build environments using AWS CodeBuild. Which build specification configuration allows this?
⚠ Common exam trap
Many candidates confuse sequential build phases with parallel execution, or assume that environment variables or multiple artifacts can achieve parallelism, when only the batch build feature in CodeBuild provides true parallel builds across multiple environments.
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
✓
Define a batch build with multiple builds.
AWS CodeBuild supports batch builds, which allow you to define a build project that runs multiple builds in parallel. By specifying a batch configuration in your buildspec file (using the `batch` section), you can run unit tests across multiple build environments simultaneously, improving test execution speed and resource utilization.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use multiple build phases in the buildspec file.
Why it's wrong here
Buildspec phases enforce a strict lifecycle (install, pre_build, build, post_build) that executes sequentially in a single compute container. Placing test commands in multiple phases only splits the timeline; it does not spawn additional builds or instances. Therefore, while you might interleave setup and test steps, you remain limited to one build's resources and get no wall-clock speedup from parallel execution.
- ✗
Configure multiple artifacts in the buildspec.
Why it's wrong here
The artifacts section in buildspec declares files to upload to Amazon S3 after the build completes. Declaring multiple artifact groups (or using secondary artifacts) merely packages different outputs; it has zero effect on how the build's commands are scheduled. The build itself still runs to completion on a single instance before any artifacts are produced, so this cannot parallelize unit test execution.
- ✓
Define a batch build with multiple builds.
Why this is correct
A batch build lets you define multiple builds that CodeBuild schedules on separate compute environments, running them concurrently up to the configured max batch size or parallelization limit. Each build in the batch can have its own buildspec override, environment variables, or input source, making it ideal for sharding unit tests across workers. This is the intended AWS mechanism for executing independent unit tests in parallel.
- ✗
Set environment variables to run multiple commands concurrently.
Why it's wrong here
Setting environment variables only provides configuration (e.g., test shard indices, feature toggles) to a single build environment. Even if you use them to make commands conditionally run, those commands still execute serially within the same shell process unless you explicitly background them with tools like `&` or GNU parallel — which still only uses one build machine. Environment variables do not instruct CodeBuild to spin up additional builds or scale compute, so they cannot achieve true parallel execution.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-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 DOP-C02 exam.