Altran, in association with Microsoft, has launched a new artificial intelligence-based tool that has been designed to predict and identify the source code files that are carrying a higher risk of having a bug.
According to Microsoft’s webpage — “Developers are presented with explanations and factors used in making the specific prediction.”
Using machine learning onto historical data allows the AI-based tool — Code Defect AI – to identify the areas of the source code that are potentially bugged. The tool further suggests a set of tests in order to diagnose and fix the anomalies, which in turn will result in higher-quality software and faster development times.
According to Microsoft, bugs are a fact of life in software development. Bugs need to be identified and rectified at the earliest, as more time it takes to defect a flaw in the development lifecycle, the higher the cost becomes of fixing the bug. Traditionally, this bug-deployment-analysis-fix process is time-consuming and costly, and therefore required a tool that can speed up the process. Alongside, if a defect is found after deployment, it impacts the customers profoundly, and then developers end up spending more time to fix the bug.
The new AI-based tool — Code Defect AI, on the other hand, allows the earlier discovery of defects and anomalies, which in turn minimises the cost of fixing them and speeding the development cycle.
According to Walid Negm, Group Chief Innovation Officer at Altran, software developers are always working under continuous pressure to release code fast without compromising on quality. However, the reality is that the development process of software requires more than the automation of assembly and delivery activities. It requires heavily working on algorithms that can help make strategic judgments ‒ especially as code gets more complicated. Code Defect AI does precisely that.”
Code Defect AI relies on various machine learning techniques, which includes random decision forests, support vector machines, multilayer perceptron, and logistic regression. For the tool, the historical data is extracted and then pre-processed and labelled in order to train the algorithm and develop a reliable decision model. With this tool, the developers can quickly predict whether the source code is compliant and has the potential of containing bugs.
According to Microsoft, In machine learning, supervised learning let algorithms predict an output based on historical examples of input-output pairs, i.e. labelled data. Further, supervised learning is termed as a classification problem if the output variable is discrete; however, specific patterns in the software project’s code base carry a higher risk of introducing a bug. These patterns can be learnt by a classification learning algorithm to predict the prospect of a file in a commit having a bug. This allows shift left of defect discovery, thus minimising the cost of fixing defects.
Microsoft further stated that three custom classification models had been created for three GitHub projects based on metadata associated with the historical commits. Labelled data for training the model has been created using the metadata collected from the GitHub repository. When the news AI-based tool Code Defect AI discovers new developer commits, it obtains the metadata for each of the commits and then utilises it to predict the bugs.
“Traditional machine learning models are black boxes, and the rationale behind the model’s prediction is not available. We present the rationale behind the prediction using Local Interpretable Model-Agnostic Explanations (LIME) so that users develop a greater trust in the prediction,” stated Microsoft.
Code Defect AI also supports integration with third-party analysis tools, which makes it extremely easy to use for developers.
When asked, David Carmona, General Manager of AI Marketing at Microsoft, said to the media that the two companies are working together to enhance and speed up the process of the software development cycle. This new tool — Code Defect AI, powered by Microsoft Azure, can solve several challenges for developers with the use of machine learning.
This new AI-based solution is scalable as it can be hosted on-premise as well as on cloud computing platforms such as Microsoft Azure. The solution has been presented on Github and can be integrated with other source-code management tools as needed. The tool is also available on the Microsoft AI Lab portal for developers to download and use it internally in their organisation.