AI application in modern software development

Software development is surrounded by a myriad of methods, process models, ecosystems, plugins, languages, architectures and best practices. In addition, the whole complex of “software development” is constantly changing - new requirements, new programming languages, new tools. And anyway, where can I actually find the trained specialists for all these technologies these days? Many factors contribute to the fact that in-house software development can sometimes be expensive and sometimes risky.

Depending on the nature of the problem to be solved with software, there are of course various solutions. Sometimes it is enough to resort to purchased software, either on-premise or SaaS, nowadays also often no- or low-code. For the latter, reality confirms that the workload is actually reduced and workloads are shifted from IT to the specialist area. This also minimizes friction effects at the corresponding interfaces between IT and the business department.

AI-supported coding tools as enablers for in-house software development? - Let us take a look at Github Copilot

Then again, there are situations where you need to develop your own software. There are good reasons to develop software yourself. For example, if there is no ready-made, market-ready solution for a specific problem, or if you expect to gain a significant advantage on the market with your own solution. In times of a shortage of skilled workers, it makes sense to maintain and enable valuable developer resources and to use them as efficiently as possible. Some time ago, Github presented an exciting AI-based optimization solution for the process of programming, i.e. the very own task of a software developer, in the technical preview - the “Github Copilot”.

According to Github, the copilot in question is “your AI pair programmer”, i.e. an artificial intelligence that is at your service when the programmer’s head is spinning despite or because of the fifth cup of coffee and it just won’t work to find an elegant solution for the method, which is bursting with cyclomatic complexity. Technologically, the Copilot is based on the AI system Codex developed by OpenAI, the real hero of our story. Trained on publicly available program code and natural language, a powerful AI model has been created that aims to create an interface between these two types of input. The Github Copilot is then an integration layer on top of Codex and adds its functionalities to the existing code completion tooling of an IDE (e.g. VSCode or IntelliJ).

What are the capabilities of Github Copilot?

Together with a colleague, I recently took a look at the capabilities of Copilot. And what can I say? It can even generate jokes. Want a taste? After the request “Tell me a joke” in a code comment, the automatic textual suggestion appears when typing a console log:

“What did the cheese say when it looked into the mirror?” - “Hello-me (halloumi)”

There are also answers to important questions of the time. The variable isCovid19Real is automatically initialized with true. The same applies to the variable areBirdsGovernmentSpies. So some things are simply true, others make you smile.

However, the Github Copilot can actually do much more. For example, corresponding implementations can be generated using natural descriptive language in comments or in a method name. The resulting implementation can even be further refined using continuous comments. This works surprisingly well in the test. For example, we were able to generate a method in a matter of seconds that outputs successive Fibonacci numbers and adds a string prefix to each number. We also obtained a clean solution for calculating a time difference in a described time unit for two time formats passed as method parameters. If we change the object type of one of the passed method parameters, the copilot automatically adapts the implementation. It is also helpful that we usually receive various suggestions for a problem, from which we can choose the most suitable solution. Copilot is not a search engine, but a “code synthesizer”. According to Github’s own study, a large proportion of the generated code is unique in relation to the data basis used. However, this uniqueness is naturally subject to limits, as in any descriptive system with rules and limitations. This is not a bad thing as long as there is a convergence to an optimal solution.

How useful is an AI-supported coding tool?

The Github Copilot can at least partially relieve the browser cache, because some of the open Stackoverflow browser tabs of every developer can now be closed and remain closed. Stackoverflow and other discussion pages about programming are not only a natural source of solutions in the programming rooms of this world, but also a real source of explanations. So if you want to understand why a solution might be good and useful and save yourself an internet search next time, you still have to seek contact with other real programmers. For experienced developers, Copilot is helpful as an intelligent code completion tool “out-of-the-box” to quickly generate initial implementation suggestions for entire methods or for specific problems in day-to-day business. For less experienced developers, Copilot at least provides initial clues whose usefulness should be questioned afterwards. This is because the greatest danger when using such a tool is blind application. If suggestions are simply adopted into a new code base without questioning their usefulness for the specific problem, this can result in “bad code” (e.g. bugs, poor performance).

What are the limitations of AI-supported programming?

At its core, programming is a creative process. Within a system with certain rules (a programming language, frameworks, etc.), solutions must be found for previously known and sometimes unknown problems using “on-board resources”. These solutions should be situationally robust, optimized and reliable. Of course, the relationship to the rest of the code base and architecture also plays a role here.

Artificial intelligence is always based on data. This data must be generated beforehand in one way or another. For programming languages such as JAVA, C++ and Python, there is of course a large amount of publicly accessible and high-quality code that has been written by various programmers for a wide variety of situations. The AI’s suggestions will be correspondingly good. But even then, the suggestions should be taken with a grain of salt. Github’s own benchmark reveals that currently only around 43% of implementation suggestions are implemented correctly by the AI on the first attempt. There is also a risk of reproducing unsafe coding patterns, inserting bugs or using APIs that can no longer be used. Github itself writes:

„There’s a lot of public code in the world with insecure coding patterns, 
bugs, or references to outdated APIs or idioms. 
When GitHub Copilot synthesizes code suggestions based on this data, 
it can also synthesize code that contains these undesirable patterns.“

It can also be concluded that when new programming languages are used, the AI will have correspondingly greater problems generating good and meaningful suggestions. But the devil is in the detail. Many programming languages are similar. Here, AI can certainly benefit from a broad data basis.

What other tools are available for AI-supported programming?

But it’s not just Github, a platform that incidentally belongs to Microsoft, that is working on AI-supported programming tools. Providers such as Tabnine, Kite and Sourcery, which pursue similar approaches, are also worth mentioning. Tabnine and Kite offer support for various programming languages, while Sourcery is limited to supporting Python. However, none of these tools go as far as Github Copilot or Codex, which allows the creation of code based solely on natural language. The Github Copilot was preceded by Microsoft initiatives such as DeepCoder or the efforts of the PROSE research project. However, other tech companies are also focusing on AI-supported programming. Google, for example, specifically uses the capabilities of an AI in its AutoML tool to create better AI systems and thus give less experienced developers the opportunity to perform machine learning. Amazon developed the AI tool CodeGuru to give developers the opportunity for an intelligent code review.

Will the use of AI make programmers superfluous in the future?

In view of this rapid development in the field of AI-supported programming, future enthusiasts are naturally also asking themselves whether an AI-based system will be able to replace a programmer in the foreseeable future? At present, the answer to this question is a clear “no”.

In terms of software solutions, purchase, low-code and no-code solutions will probably prevail in the medium term wherever there is nothing original and essentially innovative to implement. What these solutions have in common is that the same code is used for the same problems and, in the best case, this code is thoroughly optimized by the provider. In the short and medium term, the usefulness of an AI programming approach in such situations is certainly limited.

In the case of in-house development, the choice of technology, the planned architecture and the complexity of the underlying functions influence the options for using an AI programmer. However, even under optimal conditions, it is still necessary to make the following observation: The generated code can only serve as support, it is not error-free and cannot be automatically integrated into the complex context of an application landscape without further ado.

Nowadays, AI systems can be used specifically to increase the efficiency of developers in their daily work. Promoting the use of modern systems therefore has a direct impact on the efficiency of in-house development projects. To put it bluntly: It can be speculated that this may even be a way to temporarily cheat the shortage of skilled workers. However, it is not yet possible to completely replace programmers with artificial intelligence. Only a human programmer can currently implement program code based on complex specifications and requirements, link a multi-layered tech stack or solve difficult problems. We can also expect that the role of the software developer will not disappear in the future, but will simply change. Instead of writing code themselves, in future a software developer may primarily curate data on the basis of which an AI efficiently writes code. Perhaps we will all end up becoming data scientists.

Please note that this article has originally been published with a former employer and is available here in its original german version in full length