D5: Testing & Security with Copilot
GH-300 GitHub Copilot exam practice questions · 10 flashcards
Question
Generating unit tests?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Testing & Security with Copilot practice questions and answers
- Generating unit tests?/tests or ask for tests with a specific framework.
- Integration tests?Ask Copilot to create tests for interactions between components with setup/teardown.
- Identifying edge cases?Ask 'what edge cases should be tested?' — nulls, boundaries, errors.
- Writing assertions?Copilot suggests asserts for expected outputs and exceptions.
- Fixing failing tests?/fixTestFailure or paste errors into chat.
- Security improvements?Ask Copilot to review for vulnerabilities (injection, validation, secrets).
- Performance optimizations?Ask to identify inefficiencies and suggest faster algorithms.
- Test-driven development with Copilot?Write tests first, then ask for implementation.
- Mocking?Copilot generates mocks/stubs for dependencies.
- Scenario: improve coverage of a function with many branches. Prompt?'Generate unit tests covering all branches and edge cases for #selection'.