Professional Cloud Developer Exam QuestionsBrowse all questions from this exam

Professional Cloud Developer Exam - Question 88


You are developing an application that reads credit card data from a Pub/Sub subscription. You have written code and completed unit testing. You need to test the

Pub/Sub integration before deploying to Google Cloud. What should you do?

Show Answer
Correct Answer: AD

To test the Pub/Sub integration effectively before deploying to Google Cloud, you should create a service to publish messages and deploy the Pub/Sub emulator. Generating random content in the publishing service provides a robust way to simulate various data formats and scenarios that your application may encounter. This comprehensive approach ensures that all edge cases and potential issues are identified in a controlled environment, helping to avoid any problems that might not have been caught during unit testing.

Discussion

7 comments
Sign in to comment
scaenruyOption: D
Jan 9, 2022

I vote D

tomato123Option: D
Aug 20, 2022

D is correct

lakilukOption: D
Oct 25, 2022

Vote D

zellckOption: D
Dec 22, 2022

D is the answer.

amierOption: D
Jul 17, 2023

D is correct

wanrltwOption: D
Nov 21, 2023

https://cloud.google.com/pubsub/docs/emulator

thewalkerOption: A
Jul 18, 2024

The best answer is A. Create a service to publish messages and deploy the Pub/Sub emulator. Generate random content in the publishing service and publish to the emulator. Here's why: Pub/Sub Emulator: The Pub/Sub emulator provides a local environment that mimics the behavior of the production Pub/Sub service. This allows you to test your application's Pub/Sub integration without needing to deploy to Google Cloud. Testing with Random Data: Generating random content in the publishing service ensures that your application can handle various data formats and scenarios. This helps identify potential issues that might not be caught by unit testing alone. Controlled Environment: Using the emulator gives you a controlled environment where you can easily manipulate the messages being published, allowing you to test different scenarios and edge cases.

thewalker
Jul 18, 2024

Let's analyze why the other options are less suitable: B. Collect messages from production and replay: This approach is risky because it involves using real production data, which might contain sensitive information. It also doesn't provide a controlled environment for testing. C. Collect messages from production and publish to the emulator: This approach still involves using real production data, which can be problematic. It also doesn't allow for testing with random data or controlled scenarios. D. Publish a standard set of testing messages: While using a standard set of messages is helpful, it might not cover all possible scenarios. Generating random content provides a more comprehensive test.