How machine learning is being used in software delivery

Software delivery is a continuous process for most modern software teams

pietro jeng n6B49lTx7NM unsplash 1

On any given day, new code is being written, old code is refactored, third-party libraries are added and removed, external APIs are integrated, and plenty more. Software delivery is no longer an explicit stage at the end of development, but instead, it is a continual procedure within the daily development process, with deployments occurring daily or even hourly. Machine learning processes are now more than ever being applied to software deployment to save time and optimize processes so that software companies can continue to develop and deploy efficiently.

What it is and why it matters

Machine learning (ML) refers to the process of developing algorithms to identify patterns and develop models based on data sets. These analyses can provide insights into data that otherwise remain hidden. Not only that, but these machine learning tools may also be empowered to take actions automatically based on the predictions it generates.

What is particularly powerful in ML is the ability to crunch big data in real-time or near real-time. This is very valuable in the world of software delivery, where software may be in use by millions of users simultaneously at any given time. Pushing out updates to these users is critical to ensure that all users are kept updated with bug fixes and new features, regardless of the device or platform used. Machine learning can aid in the software delivery process by analyzing data logs, detecting errors, and making decisions based on those errors before they reach millions of users across the globe. Faulty software can kill software companies, so the added complexity of rapid, modern deployment processes must be managed without sacrificing software quality.

The role of Machine Learning in software development

Continuous testing and continuous integration have become a core philosophy in software development. This fast-paced style of development breaks what were traditional phases in software development. Rather than having distinct planning, development, and testing phases, instead, software is seen as a living product that is continuously being tested and developed.

Continuous integration advocates that each commit by a developer should be tested and then, pending passing the test suite, integrated into the live environment. This style of development is particularly popular with SaaS solutions and results in very incremental improvements to software over time, rather than as larger, discrete updates. The problem is that over time, test suites can become very bloated with the cumulative addition of newer tests, such that testing can take long enough that it becomes a significant bottleneck in the deployment process when tests are being performed on every commit. Machine learning processes are helping to change this by using data-driven insights to optimize both the code and the tests.

Machine learning applications in software delivery

Machine learning has become very useful in many different areas of software delivery. Developers who work in environments that advocate CI/CD methodologies deliver software updates at a rapid pace, so providing them with the tools they need to know their commits are safe, work as intended, and do not produce extraneous bugs at a rapid pace is very important. Machine learning processes can help with this in several ways.

Software testing

Continuous testing considers testing an integral part of every step of the development process, rather than as a discrete phase at the end of a development cycle. In this case, a product is tested at each stage, throughout planning, prototyping, developing, and deploying code.

These tests take many different forms. Unit testing, API testing, UI testing, and more all fall under the scope of continuous testing. However, while a large portion of the tests can be automated, they do not all deliver results at the same time. UI testing will typically take longer to perform than unit tests, for example, and part of the UI test suite may involve manual testing. This causes delays in the time it takes for a developer to submit code and get feedback.

Machine learning applications can develop a model of a codebase based on past error logs and regression test suite analysis that enables predictions to be made about how a new commit will interact with the codebase. This gives developers much more rapid testing feedback than having to wait for entire test suites to complete before discovering if there are any problems.

Code optimization

Developers are used to compilers optimizing code, but this practice need not be limited to compilation. As software becomes more complicated, its deployment environments become less predictable. Cloud-based services often run on virtualized servers that are not maintained directly by the development team. One solution is to use containerized applications to provide consistency, but machine learning processes can be used to instead optimize application settings and environment configurations based on their deployment environment. This can help maximize product performance and harmonize development across platforms and environments.

Machine learning can also be trained to enforce coding guidelines. Large and mature software products can become very unwieldy over time as they are constantly being worked on by hundreds of developers. Keeping code clean and standardized helps make it clear to developers what units of code do without having to spend time researching or being taught. Machine learning processes can detect deviations from coding guidelines in commits and create rewritten suggestions before commits are added to the codebase, keeping a codebase tidy and enforcing guidelines without the need for manual review.

Accelerate software delivery

Machine learning helps automate development and testing processes. A crucial part of testing is test maintenance – something that is a necessity to keep tests concurrent with software. This can be particularly time-consuming for areas that change frequently, such as UI testing. Machine learning processes can not only help to generate self-healing tests that cut down on maintenance time, but they can also highlight areas of code most in need of testing.

This increases the value of tests in a test suite. Machine learning processes can offer insights that help optimize testing and test coverage. Rather than a scattershot approach that tests everything, machine learning instead provides developers with data-driven insights into where tests are most valuable as part of the decision-making process.

The future of machine learning and software development

Machine learning is a relatively recent and rapidly-innovating addition to software development. The models used and their applications are constantly changing and improving, particularly as they are becoming more widely used and embedded in a range of different processes. As more processes in software development become automated, these machine learning tools will be entrusted with greater decision-making powers.

Currently, machine learning processes are mainly used as an aid in the decision-making process. They can flag suspected errors, predict potential bugs, and provide valuable insights, but the decision of what to do with this information is still typically left to a human being. This is partly an issue of trust and partly of tradition. Many processes in software development and deployment rely on human intervention because that is how it has always been.

Looking ahead to the future of machine learning and software development, the algorithms that power the machine learning processes will only become more refined, and the models generated will further improve based on more data and more fine-tuned analysis. It seems inevitable that more of these processes will be empowered with the ability to automatically make more significant decisions based off the results of its own analysis.

It is possible that one day, developers will not need to write tests for the code they create. Instead, tests will automatically be generated as code is written, and predictive analysis will inform the developer whether the code written will have the desired effect on a codebase before it is even committed.

Erik Fogg