Flashcardsfor IT Certifications

D2: Writing Unit Tests with AI Coding Assistants

Google Cloud Professional Cloud Developer exam practice questions · 10 flashcards

Question
What is a unit test?
1 / 10

Tip: Space flips the card, ← / → navigate.

Last updated: · Report an error on this page

Show all 10 Writing Unit Tests with AI Coding Assistants practice questions and answers
  1. What is a unit test?
    Tests a small unit of code in isolation.
  2. How can AI assistants help testing?
    Generate test cases, edge cases and mocks from code.
  3. Why review AI-generated tests?
    They may test wrong behavior or be superficial.
  4. What makes a good unit test?
    Fast, isolated, deterministic and focused on one behavior.
  5. Why mock external services?
    Isolate units and avoid network calls.
  6. How to prompt for better tests?
    Provide function code, expected behavior and edge cases.
  7. What is test coverage?
    Percentage of code exercised by tests.
  8. Why run tests in CI?
    Catch regressions on every change.
  9. Test-driven development?
    Write tests before code.
  10. Should emulators be used in unit tests?
    Prefer mocks for unit tests; emulators for integration tests.