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 questions
Answer options
A: GitHub Copilot may introduce security vulnerabilities by suggesting code with known exploits. Correct answer
B: GitHub Copilot may decrease developer velocity by requiring too much time in prompt engineering.
C: GitHub Copilot's suggestions may not always reflect best practices or the latest coding standards. Correct answer
D: GitHub Copilot may increase development lead time by providing irrelevant suggestions.
Correct Answer:
A. GitHub Copilot may introduce security vulnerabilities by suggesting code with known exploits.; C. GitHub Copilot's suggestions may not always reflect best practices or the latest coding standards.
Explanation

GitHub 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.

Why Incorrect

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.

References

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).

Scroll to Top