AWS Introduces Amazon Q Developer Agents for Automated Testing, Documentation, and Code Reviews

An Amazon Web Services sign hangs up in the hallway at the company's re:Invent conference on December 2, 2024. Photo credit: Ken Yeung

Amazon Web Services (AWS) has unveiled a slate of enhancements for Amazon Q, its generative AI coding assistant. Announced at this year’s re:Invent conference, the company is launching several new features to make it easier for developers to innovate. Starting today, Q Developer has a built-in agent to automate the end-to-end process of generating and applying unit tests. In addition, it can now automate documentation creation and make code reviewing more efficient by looking beyond identifying security vulnerabilities

Disclosure: I attended Amazon's 2024 re:Invent as a guest, with a portion of my travel expenses covered by the company. However, Amazon had no influence over the content of this post—these thoughts are entirely my own.

“Amazon Q Developer is fundamentally transforming how developers work and can speed up a variety of software development tasks by up to 80 [percent], providing the highest reported code acceptance rate of any coding assistant that suggests multi-line code, code security scanning that outperforms leading publicly benchmarkable tools, and high performing AI agents that autonomously reason and iterate to achieve complex goals,” Deepak Singh, AWS’ Vice President of Next Generation Developer Experience, remarked in a statement.

“For these reasons and more, customers are embracing Amazon Q Developer to increase developer productivity at every stage of the software development lifecycle. With today’s announcements, we are automating some of the most tedious aspects of building and operating applications, removing the undifferentiated work from software development to multiply the impact of every developer.”

An Agent to Automate Unit Tests

AWS says Amazon Q Developer can autonomously identify and generate unit tests. But what is a unit test? It’s a small, focused examination verifying the behavior of a specific component or “unit” within a software application. The test ensures the coding works as intended while isolating it from the whole system. One significant benefit is that it makes debugging and validation easier.

By automating these unit tests, AWS hopes to reduce the number of human errors that occur through manual exams. Furthermore, automated tests will provide a consistent and accurate review every time, proving to developers that no missed edge cases exist.

Here’s how it works:

From the IDE, developers just type “/test” in the Amazon Q Developer chat window or highlight the relevant block of code, right click, and select “test.” Amazon Q Developer then uses its knowledge of the entire project to autonomously identify and generate tests and add those tests to the project, helping developers quickly verify that the code is working as expected. In GitLab, developers can use Amazon Q Developer with the “/q test” quick action on a merge request to automatically generate tests for the code, saving time and improving test coverage across the organization.

Ultimately, with AI picking up this slack, code quality will likely improve while freeing developers to spend time on more enjoyable and creative tasks.

Automating the Creation of Documentation

Another task Q Developer will assume responsibility for is documentation. AWS’ bot will now generate and maintain accurate documentation for the code developers write. As you can expect, this eliminates a task developers likely dread, explaining what they built–it’s like defending a college dissertation. And for projects that continue to grow in scope, the pain only gets worse.

“Keeping all the details up-to-date is a common pain point and often gets neglected,” AWS explains. And what happens if a developer leaves the company or there’s legacy code that no one is skilled in understanding? This, in turn, makes things difficult for new team members, who are forced to spend significant time figuring out how the code works on their own. The days of “getting around to code documenting later” are over.

Amazon Q Developer will automate the process of producing and updating documentation, making it easy to create and maintain accurate project records.

Documentation creation works from both the IDE and via the integrated offering with GitLab. Getting started is easy, as developers simply type “/doc” in the IDE chat to begin producing and updating README files in their repository autonomously. To accelerate their own understanding, developers can ask Amazon Q questions about how code works or use it to improve existing documentation for better readability, making it easier for their teammates to understand their code. Amazon Q Developer presents its proposed changes for the documentation, so developers can ensure the updates are accurate and align with what they intended.

Full Code Review

Though code review is nothing new to Q Developer, AWS is expanding this capability so it can automate the process. AI flags suspicious code patterns and identifies open-source packaging risks while also assessing deployment risks and suggesting mitigation options. Amazon believes that having AI do this will result in safer and more secure applications being developed.

Typically, another developer is needed to review code and ensure that it adheres to the company’s quality, style, and security standards. This can be time-intensive, taking days before the process is completed. And even after a review is done, a serious issue could be missed.

To initiate a review from the IDE, developers type “/review” in the chat, and Amazon Q will flag suspicious code patterns, identify open source package risks, and assess the potential impact of releasing changes to production. Amazon Q will also use the context it has from the developer’s merge request to adjust its recommendations, ensuring code suggestions are consistent with their style and preferences. When developers review their merge requests, they can invoke “/q review” through GitLab Duo with Amazon Q to receive feedback and streamline the review process.

One More Thing: Helping Modernize Legacy Workloads

While the features above are now generally available in Amazon Q Developer, that’s not everything AWS is bringing to the code assistant. The company has also introduced a capability for Q Developer that allows companies to migrate better and modernize legacy projects.

“We are combining Amazon Q Developer with our nearly two decades of experience helping organizations migrate and modernize their legacy workloads on AWS to accelerate and simplify large-scale transformations,” Mai-Lan Tomsen Bukovec, the company’s Vice President of Technology, says. “This is a game-changer for customers and partners looking to move off Microsoft .NET, VMware, and mainframes. Now, Amazon Q significantly speeds up application transformation projects with agents that can autonomously complete some of the most labor-intensive tasks, such as analyzing, planning, code generation, and testing, saving customers time and money, helping them realize the full value of the cloud.”

Organizations with legacy systems face higher costs and require specialized expertise to maintain them. Modernizing them requires months or years of intense and tedious work, assuming the project will be completed.

Now available in preview, AWS revealed that Q Developer will upgrade Microsoft .NET applications to Linux four times faster while reducing licensing costs by 40 percent. It’ll also turn VMware workloads into cloud-native architecture in hours, not weeks. Lastly, Q Developer can accelerate mainframe modernization with a streamlined workflow consisting of code analysis, documentation, planning, and refactoring applications.

Featured Image: An Amazon Web Services sign hangs up in the hallway at the company's re:Invent conference on December 2, 2024. Photo credit: Ken Yeung

Leave a Reply

Discover more from Ken Yeung

Subscribe now to keep reading and get access to the full archive.

Continue reading