GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 9 of 35
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?
Full set: 265 questionsThe question requires a method for testing Pub/Sub integration locally before deploying to the cloud. The official Google Cloud Pub/Sub emulator is designed for this exact purpose, allowing developers to test their application's interaction with the Pub/Sub API without incurring costs or affecting production systems. Using a "standard set of testing messages" is a fundamental software testing best practice. It ensures that tests are deterministic, repeatable, and cover known edge cases. This approach is superior to using random data and avoids the severe security and compliance risks associated with using sensitive production data (like credit card numbers) in a non-production environment.
A. Generating random content is a poor testing practice because it makes tests non-deterministic, and failures become difficult to reproduce and debug.
B. Using live production data, especially sensitive credit card data, for testing is a major security risk and a direct violation of compliance standards like PCI-DSS.
C. This option is also incorrect because it uses sensitive production data for testing, which is a severe security and compliance violation, regardless of using an emulator.
1. Google Cloud Documentation, "Testing apps locally with the emulator": "The Pub/Sub emulator provides local emulation of the Pub/Sub service. You can use the emulator to develop and test your application locally, without creating a Google Cloud project or a billing account." This supports using the emulator for pre-deployment testing.
Source: Google Cloud Documentation, Pub/Sub > Docs > How-to guides > Testing apps locally with the emulator.
2. Google Cloud Whitepaper, "PCI Data Security Standard Compliance on Google Cloud": This document outlines the shared responsibility model for PCI-DSS. Requirement 6.4.3 of the PCI-DSS standard explicitly states, "Production data (live PANs) are not used for testing or development." This directly invalidates options B and C.
Source: Google Cloud Security Compliance Documentation, PCI-DSS, Requirement 6.4.3.
3. MIT OpenCourseWare, "6.170 Software Studio, Lecture 10: Testing": University courseware on software engineering emphasizes that good testing relies on carefully chosen inputs with known, expected outputs. This principle supports using a "standard set of testing messages" (Option D) over random data (Option A) to create effective and repeatable tests.
Source: MIT OpenCourseWare, Electrical Engineering and Computer Science, 6.170 Software Studio, Fall 2005, Lecture 10 Notes.
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 1You have an application controlled by a managed instance group. When you deploy a new ver…
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
