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