DOP-C02 Question 33
Select 3You are designing a CI/CD pipeline for a large-scale web application. The pipeline includes stages for code builds, testing, and deploying to production. To ensure a balance between speed and reliability, which types of tests should be implemented at different stages of the CI/CD pipeline?
- A
Unit tests during the build stage to quickly validate basic functionality.
- B
Integration tests during the build stage to validate interactions between multiple modules.
- C
End-to-end tests during the staging environment to simulate real-world user behavior.
- D
Load tests during the production deployment to identify bottlenecks.
- E
Smoke tests immediately after deploying to production to validate critical functionality.
Show answer and explanation
Correct answers: A, C, E
Explanation
Different types of tests are suited for different stages of the CI/CD pipeline to ensure a balance between speed and reliability. Unit tests are fast and suitable for catching issues early in the build stage. End-to-end tests are more comprehensive and should be run in the staging environment to validate real-world behavior. Smoke tests are lightweight and help ensure critical functionality works immediately after deployment. Integration and load tests are better suited for specific environments outside the build and production deployment stages.
- A. Correct.
Unit tests are lightweight and fast, making them ideal for the build stage. They ensure that individual components function as expected and help catch issues early in the pipeline.
- B. Incorrect.
Integration tests are more comprehensive and time-consuming. Running them during the build stage can slow down the pipeline unnecessarily and is not a best practice.
- C. Correct.
End-to-end tests in the staging environment help validate the functionality of the application in a near-production environment, ensuring it behaves as expected for users.
- D. Incorrect.
Load tests should be performed in a controlled pre-production environment, not during the production deployment, as they can impact live users and disrupt the system.
- E. Correct.
Smoke tests are lightweight, post-deployment checks to confirm that critical functionalities are working as intended. They are useful immediately after deploying to production to catch any deployment issues.