Show answerHide answer
Correct answer: C By using specific prompt examples in your chat request.
Explanation
Summary:GitHub Copilot Chat does not automatically know your company's internal testing standards. To guide it, you must provide explicit context and instructions within the conversation. This is achieved through prompt engineering, where you describe the specific patterns, frameworks, and conventions the AI should follow to generate compliant boilerplate code.
Correct Option:
C. By using specific prompt examples in your chat request.
This is the most effective and direct method. You guide the AI by providing clear, detailed instructions and examples within your prompt. For instance, you could write: "Generate a unit test for the UserService class using Jest and following our company standard of using describe blocks for the class and it blocks for each method. Include our standard setup using beforeEach." This gives Copilot Chat the specific context it needs to match your standards.
Incorrect Option:
A. By using a specific setting in GitHub Copilot's configuration:
While there are configuration settings for features like code referencing, there is no dedicated setting to pre-load a company's specific testing standards. Guidance is provided dynamically via prompts.
B. By using a specific command in the terminal:
The terminal is a separate environment and is not used to configure the context or behavior of GitHub Copilot Chat within the IDE. Communication with the AI happens through the chat interface.
D. By using a specific slash command in the prompt:
Slash commands in Copilot Chat (like /tests or /explain) are used to trigger specific types of tasks, but they do not inherently convey company-specific standards. The standards must still be described in the text of the prompt that follows the command.
Reference:
GitHub Copilot Documentation: Prompt crafting for code generation - This official resource emphasizes that providing context and examples in your prompts is the key to getting better, more relevant outputs from GitHub Copilot.