In the last year, the use of Artificial Intelligence (AI) in software development has been growing rapidly. AI tools such as ChatGPT and Github Copilot have emerged and can assist people in various aspects of their workflow, from suggesting code snippets to generating documentation. In this blog post, we will explore the pros and cons of using AI for software development and offer some recommendations for how to best use these tools in your workflow right now.
Note: The focus in this article is on how AI tools can practically be used for developers in their daily work. Using them might potentially have legal or contractual implications too, but that is not covered in the article.
Pros of Using AI for Software Development
One of the biggest advantages of using AI for software development is the ability to speed up the development process. AI tools can quickly suggest code snippets or templates for frequently used functions or algorithms, saving developers time and effort. Additionally, AI tools can help catch errors or bugs in code, improving the overall quality of the software being developed.
Another benefit is the ability to automate repetitive tasks. This allows developers to focus on more complex tasks and problem-solving, which can lead to more innovative solutions and better software.
AI can also help software developers with creating more comprehensive and user-friendly documentation, which can ultimately improve the quality and usability of their software products. Examples could include:
- Automatic summarisation: AI can be used to automatically summarise long software documentation by extracting the most important information and presenting it in a concise format. This can make it easier for developers and users to quickly understand the software’s functionality and features.
- Automatic generation: AI can be used to automatically generate software documentation based on the code. This can save time and reduce errors by eliminating the need for developers to manually write documentation.
Cons of Using AI for Software Development
While AI can be a powerful tool for software development, it’s important to be aware of its limitations. One major concern is the potential for bias in AI-generated code. If the AI model is trained on biassed data, it may generate biassed output, which could have serious implications for the software being developed.
Another challenge with using AI for software development is the lack of transparency in how the AI models make decisions. This can make it difficult for developers to understand why the AI tool is suggesting certain code or making certain decisions.
Things to be Mindful of
There are several things to keep in mind. First and foremost, it’s important to remember that AI tools should be used as a supplement to human expertise, not a replacement for it. While AI can help speed up the development process, it’s still important for developers to understand the code they’re writing and be able to debug it when necessary.
When using AI tools like ChatGPT, it’s important to remember that they can make mistakes with the utmost confidence. Unlike humans, AI models don’t have the understanding or modesty to know if they’re incorrect. This means that while AI can be a valuable tool for generating code and suggestions, it’s important to manually review and test any code generated by the tool to ensure its correctness. Additionally, developers should be prepared to debug any errors or bugs that may arise from using AI-generated code.
Recommendations for the Future
One recommendation for the future is to be transparent about the use of AI tools in software development. If code has been generated by an AI tool, it’s important to include that information in code submissions. This will help reviewers be more mindful of the potential for bias in the code and consider this when reviewing the code.
Another recommendation is to use AI tools like ChatGPT for generating code and architecture documentation. In these cases, the exact syntax may not be as important, and you can save a lot of time getting help to structure the documents. For example, you can use ChatGPT to generate a template for a software architecture document and then fill in the details manually. This can help speed up the documentation process and ensure that you cover all the necessary aspects of the architecture. Similarly, you can use ChatGPT to generate code snippets for repetitive tasks, freeing up your time to focus on more complex development work.
Conclusion and Next Steps
AI tools like ChatGPT and Github Copilot can be powerful aids in software development, but it’s important to use them with caution and be mindful of their limitations. By understanding the potential for bias and mistakes, developers can use these tools to improve their workflow and the quality of the software they’re developing.
Our general recommendations
- Don’t use AI to write completely new code. We don’t have a full understanding of what data the model has been trained on and can’t guarantee that the output isn’t an exact copy of existing code. Based on what we know so far and on what e.g. OpenAI tells us about the source material (proprietary code has been filtered out) we still can’t be 100% sure. It is probably a good idea to, at this early stage, stray on the side of caution and not use generated code straight from the AI in production. There is a security aspect to this as well, that we haven’t even touched on.
- Instead, use AI as a tool to help with repetitive tasks, finding bugs or suggesting improvements to existing code.
- Use AI to document existing code or provide templates for tech documentation.
- Use AI for code review. However, note that the AI will not (currently) understand the context of the implementation or have knowledge of the full application. It will only help with syntax and local code structure.
- And most importantly, you always need to fully understand the code that the tool outputs, for security and quality reasons.
Looking ahead, it’s clear that the use of AI in software development will only continue to grow. By staying up-to-date on best practices and recommendations for working with these tools, developers can harness the power of AI to create better software and more efficiently solve complex problems.
Note: Parts of this article post were generated by ChatGPT and the top images were generated with Stable Diffusion.
SHARE ON SOCIAL