AZ-400 Question 117
Select 2You are working with a development team that builds a microservices-based application. They need a comprehensive test strategy that includes local tests for quick feedback, unit tests for code quality, integration tests for service interactions, and load tests for performance validation. Which two practices should you recommend to ensure a thorough and effective testing strategy?
- A
Run unit tests locally and mandate passing results before committing code. Create integration tests to validate communication between microservices in a staging environment.
- B
Rely on manual testers to conduct end-to-end checks in production only, since integration test automation is costly and difficult to maintain.
- C
Skip local tests for small changes to avoid slowing down the CI pipeline and rely on integration tests later in the process.
- D
Implement load testing in a controlled staging environment using representative data and run these tests automatically in the release pipeline.
Show answer and explanation
Correct answers: A, D
Explanation
A comprehensive test strategy typically starts with local tests to provide fast feedback, followed by unit tests to ensure code quality, integration tests to check service communication, and load tests to validate performance. Microsoft recommends implementing a 'shift-left' approach where potential issues are detected early in the development lifecycle. Refer to Microsoft� official Azure DevOps documentation on testing (https://learn.microsoft.com/en-us/azure/devops/pipelines/test/overview) for best practices, including how to automate and orchestrate different layers of tests within your CI/CD pipeline.
- A. Correct.
Option 1 is correct. Running unit tests locally before committing ensures immediate feedback on code quality, aligning with 'shift-left' testing principles. Integration tests in a staging environment help detect potential service interaction issues before production.
- B. Incorrect.
Option 2 is incorrect. Relying solely on manual testing in production introduces significant risk. Automated integration testing early in the pipeline catches service-level issues faster, reducing the likelihood of major failures in production.
- C. Incorrect.
Option 3 is incorrect. Skipping local tests for small changes often leads to unchecked defects accumulating. Local checks and quick unit tests are critical for rapid feedback and preventing regression errors in the CI pipeline.
- D. Correct.
Option 4 is correct. Load testing in a staging environment replicates real-world stress conditions. Automating it in the release pipeline ensures consistent performance tracking and helps identify bottlenecks before production.