In this article, we will explore how GitHub Copilot, a powerful artificial intelligence tool, is transforming application development. Application development has always had an artistic or creative aspect, especially in complex functionalities. However, it also includes repetitive sections and basic features that require less effort but need to be completed like the rest of the project. Thanks to the emergence of more powerful artificial intelligences capable of conducting deeper analysis, GitHub Copilot allows combining development with AI to improve times and streamline work.
GitHub is one of the world’s most important portals for sharing open-source code and was acquired by Microsoft in 2018. As part of its push towards new artificial intelligence solutions, Microsoft has developed GitHub Copilot.
GitHub Copilot is based on Codex, a new AI system created by OpenAI, the same organization behind GPT-3, the foundation of ChatGPT. However, in this case, Codex is exclusively trained on code for software development, relying on the code available on GitHub.
GitHub Copilot is an AI designed for programmers, which proposes code based on the current project and the text entered when starting development, such as comments or names of classes or functions. This service is a paid one, with a fee of €10/month for individual users and €19/month per user for businesses. However, it offers a free trial period of 2 months.
Once subscribed, Copilot works through a plugin or extension that is added to the IDE used for development, with support for most of the current major IDEs. For example, in Visual Studio, you would need to add the GitHub Copilot extension.
Once the extension is added, you need to log in with a GitHub account that has an active Copilot subscription. After logging in, Copilot analyzes the code of the current project and then the plugin can generate completely new proposed code, without copying from other sources. Depending on the case, it can suggest several additional alternatives to choose from.
The programmer must review this proposed code to verify if it fits what they actually want to achieve. Then, they can accept or reject the code. In case of rejection, Copilot can offer new solutions. As the project progresses, Copilot learns and improves the delivered proposals.
Extensions usually allow enabling or disabling Copilot. If it’s disabled, it will ask whether you want to disable suggestions globally or only for the language of the file currently being edited.
Although Copilot has been trained in many types of languages, it works particularly well for Python, JavaScript, TypeScript, Ruby, Go, C#, and C++. Given the nature of AI, as it makes more predictions and code is accepted or rejected, Copilot learns more concepts and can provide more accurate solutions.
Currently, Copilot also includes specific modules to detect patterns of insecure code and prevent the introduction of vulnerabilities.
Copilot is a relatively new technology. Although progress is fast, it still needs to learn more. To propose better code each time and make its suggestions more accurate. In simple tasks such as creating new classes and controllers, it is very effective. It can speed up development. However, in more complex tasks or bug fixing, it may still not come up with correct solutions.
In any case, developers who have tried it agree that it allows them to focus on more motivating and complex work. It also helps them be more productive and save time on repetitive and easy tasks.
At ITEQUIA, we conducted a pilot test of Copilot with a small group of 6 developers. This team is composed of individuals working on different projects with various tasks and programming languages. While the majority use .NET, React, or Angular.
During the trial, we recorded the tasks performed by the group, along with the initial time estimation they should have taken and the actual time it took to complete them. The results show a significant percentage of time savings:
Month | Savings Percentage | Time Gained |
---|---|---|
March | 5% | 48 hours |
April | 2% | 19,2 hours |
May | 3,5% | 33,6 hours |
June | 8,7% | 83,52 hours |
To understand what this percentage represents: Starting with the fact that we have approximately 160 hours to plan for each developer in a month. The percentage of time savings represents how many of these 160 hours we have been able to save by completing the planned tasks using Copilot.
In general, we have observed two types of behaviors based on the type of development:
Within the test group, there were mainly corrections done in April, and in June, there have been more new developments. We have also detected that not all developers have been able to make use of Copilot. This depends on the project they are working on and the information provided to Copilot to generate code. The use of Copilot, like any other technological tool, is not always straightforward. It requires a period of adaptation and learning.
This is a small example of the tasks performed and their results:
Language | Estimated Hours | Actual Hours | Comments | Task Type |
---|---|---|---|---|
C# | 12 Hours | 5 Hours | Method for SOAP service response processing. XML Serialization / Deserialization. | Development |
C# | 2 Hours | 2 Hours | Not helpful because the dedication time is more for investigating the error than solving it. | Defect |
YAML | 24 Hours | 12 Hours | Although it needs some initial learning time, once Copilot has enough examples to work with, documentation creation becomes a process where you only need to provide specific inputs for it to do most of the heavy lifting, such as generating structures and conditions… | Documentation |
C# | 24 Hours | 4 Hours | Using previously generated documentation in Swagger, we quickly created data models and related entities by providing associated components as input. We noticed that GitHub Copilot in Visual Studio 2022 provides more accurate results than in Visual Studio Code and avoids infinite loops in documentation generation. | Development |
javascript | 3 Hours | 2,5 Hours | It helped us detect and correct an excessively long string for a Kendo grid. | Defect |
javascript | 16 Hours | 12 Hours | It assists in completing functions by filling in parameters and facilitates LINQ queries. Additionally, when adding all the functionality while creating a new endpoint, it suggests the same structure as in other cases. | Development |
React TypeScript | 2 Hours | 2 Hours | It evolves over time and becomes more precise. However, for many tasks, there is no difference in implementation time between using Copilot and not using it. | Development |
Copilot is a very powerful tool. It allows focusing on complex developments and helps with more generic and mundane development, resulting in better times. This tool is still in its early stages. It needs more time to learn, improve, and propose correct solutions in all cases.
Developers will need some time to adjust to make good use of it. At the moment, it doesn’t always yield positive results in every task. However, it’s clear that the advantages in new developments are significant. It can greatly streamline initial tasks and projects.
To use it for corrections and fixes, more time may be required. It is also important that it continues to evolve. However, the possibilities it offers are very promising, and we expect to save time through proper use.
Are you ready to take your development to the next level with GitHub Copilot? Contact us today to discover how this powerful AI can benefit your team and projects! Don’t miss the opportunity to try GitHub Copilot and experience the difference in your workflow. We are here to help you make the most of this innovative tool!