Google’s Duet AI targets legacy software revolution

Google Cloud logo on a sign atatched to a bamboo-looking wall at Web Summit 2022
(Image credit: Getty Images)

The expansion of Google’s Duet AI tool across its cloud ecosystem could mark a “step change” in application development and modernization, according to the tech giant. 

Among a litany of new capabilities, Google said the Duet AI assistant will now be able to help developers refactor codebases of legacy applications into newer, safer programming languages.

The task of refactoring code into different languages has historically been a process that requires a great deal of time and monetary investment to achieve. 

Google has said that refactoring a function from C++ into Go, for example, takes just one natural language prompt.

“Duet AI can help you modernize your applications faster by assisting you with code refactoring,” said Brad Calder, VP and GM for Google Cloud Platform and Technical Infrastructure.

“Typically, refactoring legacy applications requires migrating and refactoring code from one language to another, which can be expensive and take months. With Duet AI, refactoring code and migrating to Google Cloud is faster and easier.”

Citing an example scenario in which developers seek to migrate from C++ to Go and begin using Cloud SQL, Calder said Duet AI could simplify the process, efficiently refactor code, and potentially reduce the manual labor involved by a significant degree. 

“If you did this by hand, you would need to convert the code from C++ to Go, learn the Cloud SQL constructs, and update the database connection to use Cloud SQL,” he said. 

“With Duet AI, you can instead open Duet AI chat right in your development environment, and write a natural language prompt as simple as ‘Convert this function to Go and use CloudSQL’,” Calder added.  

RELATED RESOURCE

Image of warehouse with multiple shelves of containers and pick truck

(Image credit: IBM)

Automating application-driven container elasticity

Discover key concepts for container platform adoption and how to protect that investment with automation.


DOWNLOAD FOR FREE

In this instance, the function would be rewritten in Go and any database connections automatically converted to CloudSQL

While Google offered no exact details on the timeframe involved here, the introduction of Duet AI in this process suggests that developers can significantly cut down on the time required for legacy code refactoring. 

Jon Mort, CTO at digital transformation consultancy Adaptavist, said the use of generative AI tools in code refactoring could unlock marked benefits for developers and reduce the burden of modernizing legacy applications. 

“Refactoring legacy codebases is often an extremely tedious and time-consuming process. In our experience, AI has proven valuable in helping streamline repetitive refactoring tasks, providing recommendations to improve code efficiency and readability, and assisting with translation into new languages and frameworks,” he said. 

RELATED RESOURCE

Whitepaper cover with title and images of multiple screens and users interacting with them

(Image credit: IBM)

Get an understanding of the conversational AI landscape, its three most common use cases, customer pain points, and see real-world success stories from clients.

DOWNLOAD FOR FREE

While Mort noted that the use of Duet AI in this capacity is still very much in its formative stage, there are promising signs that it could significantly accelerate migration processes for organizations. 

“The refactoring capabilities Google has previewed for Duet AI could certainly help ease developer burden. If developers can simply provide Duet with a prompt to refactor code or translate legacy code into more modern languages, it could greatly accelerate migration initiatives.”

In a live presentation at Google Cloud Next on Tuesday, Priyanka Vergadia, developer advocate at Google Cloud gave attendees a real-time run-through of the refactoring process using VS Code. 

Again, Vergadia migrated C++ code to Go. This entire presentation lasted a matter of minutes and was shown to be a relatively simple process, underlining the huge potential Duet AI offers in this instance. 

Vergadia’s presentation can be viewed on-demand in the wake of the opening conference keynote session on Tuesday. 

AI code refactoring

Google isn’t alone in exploring the potential for generative AI tools in application modernization and code refactoring. 

Earlier this month, IBM unveiled its watsonx Code Assistant, which is expected to be generally available in Q4 of this year. IBM framed the new developer toolkit as a step change in enabling users to analyze and refactor code - specifically COBOL. 

IBM said that the generative AI assistant will help enable “faster translation” of COBOL to Java for IBM Z customers, as well as enhance developer productivity. 

Industry efforts to encourage a move away from older programming languages have gathered pace in recent months, with the US National Security Agency (NSA) and Microsoft both pushing for the shift in a bid to improve software security capabilities.

In November 2022, the NSA called on enterprises to only use “memory safe” languages, such as C#, Java, Ruby, Rust, Go, and Swift to mitigate the risk of memory-based vulnerabilities typically associated with older languages. 

Research from Consumer Reports in January this year went so far as to argue that regulatory and financial incentives should be offered to enterprises to accelerate the adoption of safer programming languages

Ross Kelly
News and Analysis Editor

Ross Kelly is ITPro's News & Analysis Editor, responsible for leading the brand's news output and in-depth reporting on the latest stories from across the business technology landscape. Ross was previously a Staff Writer, during which time he developed a keen interest in cyber security, business leadership, and emerging technologies.

He graduated from Edinburgh Napier University in 2016 with a BA (Hons) in Journalism, and joined ITPro in 2022 after four years working in technology conference research.

For news pitches, you can contact Ross at ross.kelly@futurenet.com, or on Twitter and LinkedIn.