Google Professional Cloud Developer Question 266
Select 3Google Cloud PlatformYou are developing a serverless Python application hosted on Cloud Run. You want to ensure robust testing of the application before deployment to production. Which of the following actions should you take in your testing strategy to meet Google Cloud best practices?
- A
Write unit tests to validate individual functions in isolation.
- B
Implement integration tests to ensure services communicate correctly.
- C
Rely solely on manual testing to validate the application in staging.
- D
Use Cloud Run’s built-in request logging to analyze and debug failures during testing.
- E
Simulate high traffic scenarios using Cloud Load Testing tools.
Show answer and explanation
Correct answers: A, B, E
Explanation
A robust testing strategy for a Cloud Run application should include a combination of unit tests, integration tests, and performance testing. Unit tests validate individual components, integration tests ensure service communication, and load testing helps simulate real-world traffic scenarios. Manual testing and logging are useful but insufficient on their own for production-grade reliability.
- A. Correct.
Correct: Unit tests are essential for verifying the correctness of individual functions in isolation and are a key part of a robust testing strategy.
- B. Correct.
Correct: Integration tests ensure that different services in your application work together as expected, which is critical for serverless architectures.
- C. Incorrect.
Incorrect: Sole reliance on manual testing is not a best practice as it is prone to errors and does not scale well. Automated tests should complement manual testing.
- D. Incorrect.
Incorrect: While request logging is useful for debugging, it is not a substitute for proactive testing strategies like unit and integration testing.
- E. Correct.
Correct: Simulating high traffic with load testing tools helps identify performance bottlenecks and ensure your application can handle production-scale workloads.