AWS announced today that CodeGuru, a suite of tools that use machine learning to automatically check code for errors and suggest possible optimizations, is now widely available. The tool was launched in preview at AWS re: Invent last December.
CodeGuru consists of two tools, reviewer and profiler, and these names pretty much describe what they do. To create reviewers, the AWS team trained their algorithm using code from over 10,000 open source projects on GitHub and using reviews from Amazon's internal code base.
"Even for a large company like Amazon, with the amount of code written every day, it is difficult to have enough experienced developers with enough free time to review code," the company said in today's announcement. "And even the most experienced auditors miss problems before they impact customer-centric applications, which leads to errors and performance issues."
To use CodeGuru, developers continue to set their code in a repository of their choice, whether it's GitHub, Bitbucket Cloud, AWS's own CodeCommit, or any other service. CodeGuru Reviewer then analyzes this code, tries to find errors and in this case also offers possible corrections. All of this is done in the context of the code repository, so CodeGuru creates, for example, a GitHub pull request and adds a comment to this pull request with further information about the error and possible corrections.
To train the machine learning model, users can also give CodeGuru some basic feedback, although we're mainly talking about "thumbs up" and "thumbs down" here.
The CodeGuru Application Profiler has a slightly different task. It is designed to help developers figure out where inefficiencies can occur in their code and identify the most expensive lines of code. This includes support for serverless platforms like AWS Lambda and Fargate.
One feature that the team has added since the first announcement of CodeGuru is that Profiler is now adding an estimated dollar amount to the lines with unoptimized code.
“Our customers develop and run many applications that contain millions and millions of lines of code. It is incredibly important to ensure the quality and efficiency of this code, as errors and inefficiencies in just a few lines of code can be very costly. Today, methods of identifying code quality problems are time consuming, manual, and error-prone, especially on a scale, ”said Swami Sivasubramanian, vice president of Amazon Machine Learning, in today's announcement. "CodeGuru combines Amazon's decades of experience developing and deploying large-scale applications with significant machine learning expertise to provide customers with a service that improves software quality, excites their customers with better application performance, and eliminates the most expensive lines of code . "
According to AWS, some companies started using CodeGuru in the preview period. These include Atlassian, EagleDream and DevFactory.
"While code reviews by our development team do an excellent job of preventing errors from reaching production, it is not always possible to predict how systems will behave under stress or manage complex data forms, especially since we have multiple deployments per day," said Zak Islam, Head of Engineering , Tech Teams, at Atlassian. “If we find any anomalies in production, Amazon CodeGuru's continuous profiling feature has allowed us to reduce the scan time from days to hours and sometimes minutes. Our developers are now more focused on providing nuanced functionality and less time investigating issues in our production environment. "