An Empirical Evaluation of GitHub Copilot's Code Suggestions

By Nhan Nguyen, Sarah Nadi. IEEE Working Conference on Mining Software Repositories, 2022

395 citations recorded by the source corpus.

GitHub and OpenAI recently launched Copilot, an “AI pair programmer” that utilizes the power of Natural Language Processing, Static Analysis, Code Synthesis, and Artificial Intelligence. Given a natural language description of the target functionality, Copilot can generate corresponding code in several programming languages. In this paper, we perform an empirical study to evaluate the correctness and understandability of Copilot's suggested code. We use 33 LeetCode questions to create queries for Copilot in four different programming languages. We evaluate the correctness of the corresponding 132 Copilot solutions by running LeetCode's provided tests, and evaluate understandability using SonarQube's cyclomatic complexity and cognitive complexity metrics. We find that Copilot's Java suggestions have the highest correctness score (57%) while JavaScript is the lowest (27%). Overall, Copilot's suggestions have low complexity with no notable differences between the programming languages. We also find some potential Copilot shortcomings, such as generating code that can be further simplified and code that relies on undefined helper methods.

Subfields: Information Systems, Software

View Paper: https://www.semanticscholar.org/paper/cdfe9580f63070f311151444f9df32818cc858bf

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Shin Yoo
  2. Mark Harman
  3. Nasser Giacaman
  4. Viraj Kumar
  5. Shubho Sengupta
  6. Mitya Lyubarskiy
  7. Jie M. Zhang
  8. Angela Fan

In Software

  1. Shin Yoo
  2. Mark Harman
  3. Shubho Sengupta
  4. Mitya Lyubarskiy
  5. Jie M. Zhang
  6. Angela Fan
  7. Beliz Gokkaya
  8. Paul Denny

Citations in the corpus