Courseiva
SDLC Automation →easyMultiple Choice

DOP-C02 SDLC Automation Practice Question

A developer wants to automate the testing of a serverless application built with AWS Lambda and Amazon API Gateway. Which AWS service is best suited for running integration tests as part of a CI/CD pipeline?

⚠ Common exam trap

A common mix-up: candidates confuse AWS CodeBuild with AWS CodeDeploy, assuming that deployment services inherently include testing capabilities, but CodeDeploy only handles the deployment process and does not execute test scripts or validate application behavior.

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 best suited for running integration tests as part of a CI/CD pipeline because it is a fully managed continuous integration service that can compile source code, run tests, and produce software packages. For a serverless application using Lambda and API Gateway, CodeBuild can execute integration tests against deployed API endpoints, validate Lambda function responses, and integrate seamlessly with other AWS developer tools like CodePipeline. It supports custom build environments and can run test frameworks (e.g., Postman/Newman, Jest) directly in the pipeline.

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 CodeDeploy

    Why it's wrong here

    AWS CodeDeploy is a deployment service that automates application releases to compute platforms such as EC2, Lambda, and ECS. Although its AppSpec lifecycle hooks can execute scripts during deployments, those scripts are meant for deployment validation (e.g., health checks) and cannot replace a CI runner. CodeDeploy lacks source checkout, test orchestration, and report generation capabilities, so it is not appropriate for automating test execution in a serverless development workflow.

  • ✓

    AWS CodeBuild

    Why this is correct

    AWS CodeBuild is a fully managed continuous integration service that compiles code, runs test suites, and produces build artifacts in a scalable, ephemeral environment. Its buildspec configuration can install dependencies, execute unit and integration tests against a serverless app (using frameworks like Jest or Mocha), and publish test reports to AWS services. CodeBuild integrates naturally with AWS CodePipeline, making it the correct choice for automating testing of a serverless application.

  • ✗

    Amazon CloudWatch

    Why it's wrong here

    Amazon CloudWatch is a monitoring and observability service that collects metrics, logs, and events from AWS resources. While it can store and visualize test outputs or set alarms based on test failures, it never executes test code or orchestrates test runs. For a serverless app, CloudWatch would be used after testing to monitor application health or to observe test results emitted by CodeBuild, but it is not a testing or automation service.

  • ✗

    AWS CloudFormation

    Why it's wrong here

    AWS CloudFormation is an infrastructure-as-code service that provisions and manages AWS resources via declarative templates. It can deploy serverless components like Lambda functions and API Gateway, but it has no built-in mechanism to run tests. Using custom resources to invoke test code during stack creation is an anti-pattern and lacks proper reporting, caching, and CI pipeline integration. Thus, CloudFormation is meant for infrastructure deployment, not for automating test execution.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.