GH-300 practice question 7 of 10
What are the potential risks associated with relying heavily on code generated from GitHub Copilot? (Each correct answer presents part of the solution. Choose two.)
Full set: 135 questionsGitHub Copilot is trained on a vast corpus of public code, which includes a wide spectrum of quality and security. Consequently, it can inadvertently reproduce patterns from this data that contain known security flaws or do not adhere to modern best practices. Heavy reliance on its suggestions without rigorous review and validation by the developer can lead to the introduction of vulnerable or suboptimal code into a project. The developer remains the ultimate authority and is responsible for the quality, security, and correctness of the final codebase.
B. GitHub Copilot is designed to increase developer velocity by automating repetitive coding tasks and reducing boilerplate, not decrease it.
D. While some suggestions may be irrelevant, the tool's overall purpose and measured impact is to reduce, not increase, development lead time.
1. Official Vendor Documentation: GitHub Copilot Trust Center. In the "Security" and "Code Quality" sections
Microsoft explicitly states
"You are responsible for ensuring the security and quality of your code. We recommend you take the same precautions when using code generated by GitHub Copilot that you would when using any code you didn’t write yourself. These precautions include rigorous testing
IP scanning
and checking for security vulnerabilities." This directly supports the risks outlined in answers A and C.
Source: GitHub. "GitHub Copilot Trust Center." Accessed 2023.
2. Peer-Reviewed Academic Publication: A 2021 study evaluated the security of code generated by GitHub Copilot across 89 different scenarios. The study found that approximately 40% of the generated programs contained security vulnerabilities
often stemming from the top suggestion. This empirically validates the risk of introducing security flaws (Answer A).
Source: Hammond
P.
Pearce
H.
et al. (2021). "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions." 2021 IEEE Symposium on Security and Privacy (SP)
pp. 1-18. DOI: 10.1109/SP40001.2022.00092. (Specifically
see Section IV. FINDINGS
which details the prevalence of vulnerabilities).
3. Peer-Reviewed Academic Publication: Research on the quality of AI-generated code highlights that models like Copilot
trained on public repositories
can suggest code that is outdated
non-idiomatic
or uses deprecated APIs. This directly supports the concern that suggestions may not reflect current best practices or standards (Answer C).
Source: Yetistiren
B.
et al. (2023). "Assessing the Quality of GitHub Copilot's Code Generation." Proceedings of the 20th International Conference on Mining Software Repositories (MSR '23)
pp. 634–645. DOI: 10.1109/MSR59073.2023.00088. (Specifically
see Section 4.2
"Code Quality Analysis
" which discusses issues like outdated practices).
Keep practicing
Take the free GH-300 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GH-300 practice questions
- Question 1Which of the following GitHub Copilot Business related activities can be tracked using th…
- Question 2How does GitHub Copilot Chat utilize its training data and external sources to generate r…
- Question 3What is the correct way to exclude specific files from being used by GitHub Copilot Busin…
- Question 4How can you improve the context used by GitHub Copilot? (Each correct answer presents par…
- Question 5What is a benefit of using custom models in GitHub Copilot?
- Question 6How does GitHub Copilot Chat ensure that a function works correctly?
