Today’s continuous integration bottlenecks need AI for code
The impact artificial intelligence could have on software development is ripe for speculation. Will AI help create prototypes in days, instead of months or years? Will it teach human developers how to code better? AI research is broad and code is flexible, so it’s hard to imagine what software development will look like when intelligent programs can help us interact with code.
What many developers and tech managers don’t realise is that AI has made huge leaps in its usefulness for development teams in the last several years. In fact, the early stages of AI-assisted software development are already here.
Mind the Gaps
It’s hard to find an organisation that doesn’t have continuous integration (CI) as a goal, and automation technology has made this achievable at scale. Automatically running tests has improved software quality in the last decade by allowing developers to get immediate feedback on their code changes and adjust accordingly. Automated software pipelines make use of robot assistants that generate pull requests, enabling the continuous delivery of updates.
But the companies that have embraced the technology are sometimes finding that automation alone isn’t enough. Automated processes still have gaps where work has to be done manually, most of which surround the creation of new code. For example, automating the execution of hundreds or thousands of unit tests can be done quickly, but progress bottlenecks when it takes hours or weeks for the development team to write the tests themselves. Without tests to validate commits, automated pipelines promote junk. What would otherwise be an automatic process is broken up by the need for ongoing manual effort as new code (and new tests) are added.
The Testing Tasks Where AI Excels
Currently, existing AI for code technology can address both of these issues in one go, by automatically writing test code that validates the rest of the automation pipeline. This type of task previously required a developer’s time, preventing them from doing the more fulfilling and value-adding work, such as creating new features. AI used for unit testing opens the door to the more complete automation of important, but slow and tedious, processes.
As might be expected, tests created by AI look different from those written by humans, but they will be produced in a fraction of the time and they function just as well, if not better, to ensure that any code-breaking changes are caught while it’s still easy to fix them. After all, as Martin Fowler has summed up in his 2006 article on Continuous Integration: “Imperfect tests, run frequently, are much better than perfect tests that are never written at all.”
In this way, AI can start to break down the trade-off between time, cost and quality of work that developers and IT managers struggle with. AI-assisted development can empower developers to create new products faster and more cost-effectively without compromising on quality. With repetitive tasks completed reliably and at speed, developers can get back to the creative tasks that attracted them to their jobs in the first place.
AI for Code is Already Here
In some industries that place a high value on the quality of their code, such as finance, AI-assisted software development is already in use. Goldman Sachs, for example, recently used AI for code to improve the efficiency of their software development. By leveraging an AI tool to write over three thousand unit tests for one legacy application with fifteen-thousand lines of code, they created an entire test suite in hours. Compared to spending an average of 30 minutes writing each unit test manually, the AI tool was able to write tests more than 180 times faster. All told, the bank managed to save over a year of developer time.
As AI technology continues to advance and solutions for more use cases are developed, investments in AI for software development will become more common across industries. It won’t be long before integrating a new level of efficiency-boosting tools into the development process is a requirement in order to embrace continuous integration and grow at scale. But in the meantime, the first iterations of AI-assisted software development are already here and giving a glimpse of what we can expect from the future of coding.
Written by Mathew Lodge, CEO at Diffblue