Does GitHub Copilot improve code quality?



GitHub Copilot , introduced in 2021 by the software development platform GitHub, is a feature that automatically completes incomplete code, and past research has shown that it can speed up coding by up to 55%. So, what about the quality of the code itself? Is it really good code? The official GitHub blog reports the results of a survey.

Does GitHub Copilot improve code quality? Here's what the data says - The GitHub Blog

https://github.blog/news-insights/research/does-github-copilot-improve-code-quality-heres-what-the-data-says/



GitHub Copilot was

announced in 2021 as a source code completion feature and will be available to all users from 2022.

'GitHub Copilot', which automatically completes source code 'continuation', is now available to all users - GIGAZINE



According to a 2022 survey of early users, 88% of users responded that their productivity had increased. JavaScript-savvy developers were divided into two groups: those who used GitHub Copilot and those who did not, and asked to build an HTTP server. The average work time for developers who used GitHub Copilot was 1 hour and 11 minutes, while the average work time for developers who did not use GitHub Copilot was 2 hours and 41 minutes, showing that task speed was 55% faster.

Research: quantifying GitHub Copilot's impact on developer productivity and happiness - The GitHub Blog

https://github.blog/news-insights/research/research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/

The survey targeted 202 developers with over five years of experience and involved them creating an API endpoint for a web server. Half of the participants used GitHub Copilot, and the other half did not.

When the code was examined, the developers who used GitHub Copilot were 56% more likely to pass all 10 unit tests. The graph below shows the percentage of tests that did not pass in purple and those that did pass in green.



The code also contained 4.63 errors with GitHub Copilot compared to 5.35 without it, and the number of lines of code without errors was 18.2 with GitHub Copilot compared to 16.0 without it.



In addition, 10 developers who participated in the study and whose code passed all unit tests also conducted code reviews without knowing who wrote which code. The code that used GitHub Copilot was rated 3.62% higher in readability, 2.94% higher in reliability, 2.47% higher in maintainability, and 4.16% higher in conciseness.

From these results, GitHub concludes that 'GitHub Copilot helps generate reusable code.' As for the reason for the higher quality of the code, the number of commits and lines of code were significantly higher in the GitHub Copilot group, but the average commit size was slightly smaller, so it is speculated that 'by spending less time writing functioning code, we were able to spend more time improving the overall quality of the code.' GitHub says that this is consistent with the results of previous studies, which showed that many respondents said that 'using GitHub Copilot makes them feel more confident in their work.'

in Web Service, Posted by logc_nt