AWS Certified Developer – Associate (DVA-C02) — Question 488

A company runs continuous integration/continuous delivery (CI/CD) pipelines for its application on AWS CodePipeline. A developer must write unit tests and run them as part of the pipelines before staging the artifacts for testing.

How should the developer incorporate unit tests as part of CI/CD pipelines?

Answer options

Correct answer: B

Explanation

AWS CodeBuild utilizes a build specification (buildspec) file to define build commands, making it the standard and most efficient location to define a phase for running unit tests. Using a separate pipeline adds unnecessary complexity, and AWS CodeDeploy is designed for software deployment rather than running unit tests during the build stage. Managing tests purely via Git branches does not configure how the pipeline actually runs the test commands.