I held off for a long time, maybe longer than was smart as a consultant, but I’ve finally explored AI. I’m still not into the hype of all the large language models and the “use AI everywhere” crowd. I have come around to some useful benefits though. Many organizations struggle with tech debt and application modernization. With the recent announcement of GitHubs Copilot free tier [1] I wanted to share some recent experience with Gen AI and App modernization and discuss some of the benefits and drawbacks I encountered.
I worked on a mobile application that was written 5 - 10 years ago and the framework hadn't been updated. The app still functioned but was not able to be easily updated and due to it's age was having issues with the app stores. The original framework was AngularJS and there was no clear or easy update path for the 15 - 20 different components that made up this app. With the help of GitHub CoPilot two developers were able to fully rewrite the application, and add new functionality to bring it into a more modern experience in 4 months. This included understanding the current app, getting necessary access, User Acceptance testing, building a new CI/CD pipeline and deploying to the app store. In fact the initial conversion was done in about 7 weeks with 3 weeks of UAT before a functionally identical app was able to be deployed! The rest of the time was adding in new features to provide an updated experience while using the app.
Before we dive in it’s necessary to define Application Modernization. “Application modernization is the process of taking existing legacy applications and modernizing their platform infrastructure, internal architecture, and/or features.” [2] There are many different approaches to modernizing a legacy application often referred to as the 5 R’s (I have seen it as 7 R’s before as well). Discussing what these are, and why modernization is beneficial is better suited for a post of its own. With that in mind some of the benefits of Application Modernization (App Mod) are to make it easier to scale, enable the ability to add new features, and easier maintainability.
Generative AI (Gen AI) is a term that has been thrown around a lot recently. I’m not going to get into Gen AI vs LLMs vs ML for two reasons, there are plenty of articles out there that can describe it better than I can, and frankly I’m not interested enough in AI at the moment to dig into the details necessary to fully explain it. It is important that we have a common understanding of what Gen AI is though if I am going to discuss how it can be used to aid in App Modernization. Gen AI “is a subset of artificial intelligence that uses generative models to produce text, images, videos, or other forms of data.” [3] For this article I will be talking about how Gen AI can generate code and provide assistance in research.
As with any code repository any API keys or other security tokens should not be fed into your AI model, most AI models today use prompts and input to further refine the output and this runs the risk of your api keys or tokens being suggested as a solution for someone else.
Now that we have a common definition of Gen AI and App Modernization we can discuss how Gen AI can assist with your modernization efforts. There is no single definition of a “legacy” application; commonly for an application to be considered “legacy” it will have a few characteristics:
the program language is no longer commonly used/understood
the framework version is no longer supported
the application is not actively maintained.
These legacy applications frequently will also have limited, out-of-date, or no documentation. All of these factors make it difficult to maintain, let alone update a legacy application to be better suited for modern architecture and development practices.
For a developer (or team of developers) to modernize an application they need to first understand the existing functionality, then assuming that a full rewrite from requirements is not in order they need to determine how the existing code and framework is different from the target framework. After determining these differences the slow process of updating every file can begin. Leveraging Gen AI may be able to help a developer understand what portions of code are doing however understanding the existing functionality and the requirements driving modernization are efforts that will still largely fall on developers in the current state of AI.
Once an understanding of requirements and functionality has been achieved the developer can leverage Gen AI to convert the existing code to the target code/framework. This saves the developer from needing to learn an obsolete framework and reduces the time needed to begin realizing value from an updated application.
The reduction in the time it takes to convert the existing application to the target configuration is a huge benefit of using Gen AI to assist in the modernization effort. It is impossible for developers to know every language, framework, and configuration that exists, utilizing Gen AI allows the developer to bridge the gap between what they know and what they need to know for the conversion, reducing the need to learn both current and target frameworks. In my experience, Gen AI does extremely well in converting an existing code base from one framework to another using the proper syntax and configuration.
When it comes to converting the functionality Gen AI starts to struggle. The more common or simple a feature is or one that may have been done numerous times before are often converted correctly. The specific functionality that might set your app apart from the competition or that covers an implementation that hasn’t been done often is where Gen AI can struggle. In these cases it might generate code that uses non-existent packages or libraries, doesn’t follow current best practices, or that is slightly off in functionality. The benefit from leveraging Gen AI does still exist in these cases, having automated all of the simple pieces the developer can focus on the more complex and often more interesting functionality.
Gen AI can do more than just the initial conversion. Using Gen AI for troubleshooting errors provides different perspectives that the developer may not have considered. This can help shorten the time to correct the error, however this also is not perfect. When suggested solutions don’t work there are often a limited number of alternative solutions the AI will provide before it starts suggesting things that have already been tried. As with any AI model, how the prompt to the AI is crafted can generate different results, in our case this isn’t a bad thing but it is something to be aware of especially if a team of developers is working to do the conversion since each person may get slightly different code structures. As you convert the application make sure to check new functionality against existing so that you can correct any AI errors as you go.
Using Gen AI can greatly improve the App Modernization experience for developers and decrease the amount of time it takes to realize value from the update. It does still take well defined requirements and desired target state to have a successful modernization.
[1] https://github.blog/news-insights/product-news/github-copilot-in-vscode-free/
[2] https://www.ibm.com/topics/application-modernization
[3] https://en.m.wikipedia.org/wiki/Generative_artificial_intelligence