Covering Disruptive Technology Powering Business in The Digital Age

image
Quantifying GitHub Copilot’s Impact on Code Quality
image
October 13, 2023 News coding Github GitHub Copilot

 

GitHub, the world’s leading artificial intelligence (AI)-powered developer platform, has released new research on GitHub Copilot Chat. By using the power of natural language, developers in the study used GitHub Copilot Chat to get real-time guidance, tips, troubleshooting, remediation, and solutions tailored to their specific coding challenges—all in real time without leaving the IDE.

The research found that the quality of the code authored and reviewed was better across the board with GitHub Copilot Chat enabled, even though none of the developers had used the feature before.

Key findings include:

  • 85% of developers felt more confident in their code quality when authoring code with GitHub Copilot and GitHub Copilot Chat.
  • Code reviews were more actionable and completed 15% faster with GitHub Copilot Chat.
  • 88% of developers reported maintaining flow state with GitHub Copilot Chat because they felt more focused, less frustrated, and enjoyed coding more.

Commenting on the results, Mario Rodriguez, VP of Product at GitHub, said: “We know there’s a difference between doing something fast and doing something well. We built GitHub Copilot and GitHub Copilot Chat to improve the lives of developers by helping them focus, keeping them in the flow, and empowering them to find more joy in their work. The results have shown that these AI tools are doing that and more—we look forward to building what’s next.”

Last year, GitHub research uncovered that developers using GitHub Copilot code 55% faster. But working fast is just one part of the picture—in many cases, there has traditionally been a trade-off between doing something quickly and doing something right. That’s why, as AI accelerates and continues to write code for an increasing number of developers, ensuring good code quality is even more important.

What Does High-Quality Code Look Like?

To measure code quality, GitHub has developed a rubric of five metrics used internally at GitHub, but that also align with academic and industry standards. Participants used the metrics to differentiate between strong code and code that slows them down.

  • Code that is difficult to read makes it more challenging to maintain, improve, and document.
  • Code reuse is a cornerstone of developer collaboration. It saves time and energy, breaks down silos, and creates consistency as a whole.
  • The less repetitive the code is, the easier it will be to read, understand, and build upon. Complex code can lead to bugs and issues that will be tough to remediate.
  • Well-maintained code means that developers minimise dependencies. Maintainable code also impacts developers’ ability to search and practice code-reuse.
  • Resilient code will maintain its functionality (or at least have minimal disruption) if there are errors. This goes a long way toward ensuring that code will, simply put, work.

Using GitHub Copilot Correlates with Better Code Quality

The study investigates whether GitHub Copilot and its chatbot functionalities would improve perceived quality of the code produced, reduce time required to review the code, and produce code that passes unit testing. And by every measure, developers felt their coding improved when using GitHub Copilot.

Overall, developers shared that they felt more confident because coding is easier, more error-free, more readable, more reusable, more concise, more maintainable, and more resilient with GitHub Copilot and GitHub Copilot Chat than when they are coding without it.

“The code was so clean, I could just look at the code, know what was going on, and bring it over fairly easily to my codebase. So, I felt the code quality was very clean and easy to understand. When I was doing the pull request review using Copilot, I saw how good it was at generating proper error handling code.” said a Senior Software Engineer at a Fortune 500 company (study participant).

Improving the Final Code

Developers noted that using GitHub Copilot Chat for code reviews improved the quality of their code (when compared to doing code review without it). Those code reviews were 15% faster with GitHub Copilot Chat. A higher percentage of comments were accepted, too. In fact, almost 70% of participants accepted comments from reviewers using GitHub Copilot Chat.

These results show the impact GitHub Copilot Chat has on collaboration, and underscores the potential impact of scaling it across larger engineering teams in bigger organisations. Reducing time spent on pull requests and code reviews means developers can focus on higher-priority changes. And better-quality code from the start ensures code does not need to be rolled back later, nor does it require additional testing.

Last year’s research found 60-75% of developers using GitHub Copilot reported feeling more fulfilled in their job, less frustrated when coding, and better positioned to focus on more satisfying work. In this year’s study, 88% of participants similarly felt less frustrated and more focused. One reason is that staying in the IDE means less time spent searching and more time staying in that coveted focused flow state.

(0)(0)

Archive