DOP-C02 Question 36
Select 3Your team is building a CI/CD pipeline for a microservices-based application deployed on AWS. The pipeline includes multiple stages such as source, build, test, and deploy. To ensure the application is reliable and performant, you need to implement different types of tests at appropriate stages of the pipeline. Which of the following types of tests should be run at their respective stages?
- A
Unit tests during the build stage to validate individual components of the application.
- B
Integration tests during the source stage to validate interactions between microservices.
- C
Smoke tests immediately after deployment to validate basic application functionality.
- D
Load tests during the build stage to assess the system's ability to handle high traffic.
- E
End-to-end tests during the test stage to validate application workflows.
Show answer and explanation
Correct answers: A, C, E
Explanation
Different types of tests should be run at appropriate stages of the CI/CD pipeline to maximize efficiency and effectiveness. Unit tests are fast and ideal for catching issues early during the build stage. Smoke tests provide a quick validation of deployment success and are run post-deployment. End-to-end tests ensure the application's overall functionality and are run during the test stage. Integration and load tests have specific purposes and should not be misplaced in the pipeline stages.
- A. Correct.
Unit tests are designed to verify the functionality of individual components or functions and are typically run during the build stage to catch issues early in development.
- B. Incorrect.
Integration tests are not suitable for the source stage, as it is focused on managing source code changes. Integration tests are more appropriate during later stages such as test or pre-production.
- C. Correct.
Smoke tests are quick, surface-level tests run immediately after deployment to ensure the application is functioning properly for basic scenarios.
- D. Incorrect.
Load tests assess the system's performance under high traffic and are usually run in a dedicated environment, not during the build stage.
- E. Correct.
End-to-end tests validate complete workflows and user interactions. These are typically run during the test stage to ensure the application behaves as expected across all integrated components.