AWS CodeGuru Uses ML to Optimize Java Code

Amazon Web Services (AWS) previewed a new service at the recent AWS re:Invent 2019 conference that uses machine learning (ML) to automate Java code review. Unveiled during the keynote by AWS CEO Andy Jassy, the new CodeGuru service uses models and algorithms built on millions of code reviews Amazon has done in-house over the last 20 years.

"The question that dominates our conversations as we're thinking about what to work on and spend resources on next," Jassy told his audience, "is what else can we build that can give value to you in places where we’ve done this over a long period of time at Amazon? One of the areas ... that we thought we might be able to help further ... is code review."

Amazon CodeGuru is a managed service that leverages ML models and learned best practices to help developers improve code quality and application performance proactively with intelligent recommendations. It’s designed to help developers "find their most expensive lines of code," Jassy explained.

The service includes two components: CodeGuru Reviewer and CodeGuru Profiler. CodeGuru Reviewer analyzes code-pull requests on code repositories, while CodeGuru Profiler analyzes the performance of applications as they run. Reviewer currently supports Java code stored in GitHub and AWS CodeCommit repositories. Profiler works with applications hosted on Amazon EC2, containerized applications running on Amazon ECS and Amazon EKS, as well as serverless applications running on AWS Fargate.

CodeGuru Reviewer automatically detects code issues during code reviews before they reach production; it checks for concurrency issues, potential race conditions, un-sanitized inputs, inappropriate handling of sensitive data (such as credentials), resource leaks, and also detects race conditions in concurrent code. CodeGuru Profiler can identify when an application is consuming excessive CPU capacity on a logging routine instead of executing core business logic.

The CodeGuru tools were just presented to the public, but AWS has been using them internally for years, Jassy said. "We have 80,000 applications internally that are using the profiler part of CodeGuru, and it has led to tens of millions of dollars of savings for us," he said.

As of this writing, CodeGuru is in preview in specific AWS "regions." To see supported AWS Regions, visit the AWS Region Table for all AWS global infrastructure. More information is available on the product page.

About the Author

John K. Waters is the editor in chief of a number of sites, with a focus on high-end development, AI and future tech. He's been writing about cutting-edge technologies and culture of Silicon Valley for more than two decades, and he's written more than a dozen books. He also co-scripted the documentary film Silicon Valley: A 100 Year Renaissance, which aired on PBS.  He can be reached at [email protected].