Blog

How AI is Giving Old Legacy Systems a New Life

November 25, 2024

With many banking systems still based on COBOL, Patrick Machado, Principal Engineer for Digital Finance Solutions at Critical Software, highlights how CoBot, the AI tool developed by the company, makes it easier to understand and migrate these complex code bases, making the process faster and more efficient.

Critical Software Image

At Critical Software, we’ve been working on a game changing project that uses AI to unlock the mysteries of legacy code and breathe new life into old tech.

Acknowledging the Problem 


About 43% of baking systems are built on COBOL and 80% of in-person transactions still use this system. COBOL-based systems, although reliable, are now causing bottlenecks and making life difficult for financial institutions, that still rely on legacy systems until this day. The right way to put it is that over time they can become more of a burden than a benefit and we’re going to explore why but first let me put your overthinking minds at ease. What if there’s a way to modernize these old systems without the usual pain and frustration?  

 


Why Legacy Systems Are Holding Us Back 


But let's go back for a moment. As many of you are probably still wondering: Why should we rethink the way we approach diving into legacy systems? As I said prior, many financial institutions are still running on code written decades ago and while those systems are still rock-solid (most times, anyway), they come with some serious technical challenges. On one hand, we have a lack of experts. COBOL developers are becoming a rare breed, almost like hunting for unicorns, which means finding someone to maintain these systems can be tough. On the other hand, these systems are still difficult to modernize. Traditional methods to convert legacy code – take COBOL to Java as example - often leave you with messy, unmaintainable code and fail to address the underlying architecture. 


Bottom line is, these hard-to-evolve systems can delay operations, increase costs, and reduce agility. This will most definitely impact a company's ability to comply with regulations, meet market demands, and deliver a reliable customer experience. In a nutshell, in a fast-paced industry, failing to modernize can mean falling behind. News alert: we have the perfect solution! 

 


Our AI-Powered Solution: Making Legacy Code Easier to Understand 


Modernizing these systems doesn’t have to be a time-consuming and frustrating process anymore. Critical Software developed an AI solution, called CoBot, that helps make sense of complex legacy systems and goes beyond merely translating code. 


The modernization patterns we observe surpass simply converting COBOL to Java (or any other language) and crossing our fingers. Applications are increasingly being rebuilt from scratch, with adaptations that make sense for modern client's platforms and architecture patterns. In this scenario, having a deeper understanding of these systems can be more valuable than simple translation. 


Our AI solution dives into legacy code and explains how it works, breaking it down into easy-to-understand blocks so that developers - and even people in less technical roles - can make sense of it while preserving business logic, and smoothly migrate it to modern languages, architectures and platforms. 

 


5 Reasons Why our Solution Helps 


  • Clear explanations: The AI dives into legacy programs and explains the functionality and business logic in a simple way. 
  • Pseudo-code generation: It creates pseudo-code, giving developers a solid starting point to rewrite the code in a modern language. 
  • Data insights: It helps teams understand how the legacy system’s data flows and how it interacts with databases. 
  • Code-flow diagrams: The solution generates diagrams to visualize how the code works, making it easier to follow. 
  • Real-time feedback: In case you get stuck, the AI Bot (that’s why we called it CoBot) can answer questions about the code, helping you stay on track. 

 

 

The Results: Speed, Efficiency, and Lower Costs 


Yes, of course we tried this in a real-world scenario. Spoiler alert: we’ve made the modernization process smoother, faster, and cheaper.  

Here’s what happened when we leveraged AI to build this solution:  

  • Fast conversion: In just one week we converted an application with 4,000 lines of COBOL into Java, a process that would normally either take much longer using traditional methods or required serious COBOL expertise. 
  • High success rate in testing: During testing, 80% of test cases passed on the first try, meaning less time spent on fixing bugs and more time moving forward.  
  • Deeper understanding of business rules and logic: By preserving the business rules embedded in the code, we ensure that we don’t lose what’s most important - the logic that drives the business. 

 


In Case You’re Wondering What Technology Did We Use 


Our solution is powered by some cutting-edge Generative AI tech, such as: 

  • Large Language Models (LLMs): These models bring legacy code expertise into the equation. It’s the engine of the application. 
  • Retrieval-Augmented Generation (RAG): This technique allows the enrichment and augmentation of the LLM engine with locally gathered information, such as data models, other programs code or dependencies. 
  • Interactive AI Interfaces: Developers can interact with the solution in real-time, asking for clarifications or more detailed insights. 


If you’ve made it this far, I probably know what you might be thinking: “Oh great, another case of throwing code into an LLM, adding RAG, and hoping for the best.” I get it. This kind of talk can sound like just another buzzword-filled solution but what really made this project work wasn’t just plugging into AI, crossing our fingers and hoping for the best. 


The real magic happened through careful prompt engineering and fine-tuning. We spent a lot of time making sure the solution was flexible enough to handle a wide variety of scenarios and pull in data from different sources, all while staying accurate. We also put significant effort into how the local context was assembled in RAG, ensuring that the tool could effectively draw from relevant information and deliver precise, context-aware responses. This wasn’t just about automation for the sake of it. It was about creating a tool that understands what it is working with and provides meaningful and actionable results. It's about driving impact.  



Overcoming Challenges Along the Way 


 

Despite the great and tangible results generated, it wasn’t smooth sailing. Like any complex project, we faced a few tricky challenges along the way, and the results weren’t always flawless. For example, fully understanding the intricacies of COBOL logic sometimes required multiple interactions with the AI bot by asking follow-up questions, refining questions, and digging deeper to unravel the business rules embedded in the code. 


But here’s the key: even in those moments, CoBot provided invaluable assistance. Instead of leaving developers to sift through thousands of lines of cryptic legacy code on their own, the CoBot served as a guide, speeding up the process and reducing the manual effort needed to uncover the logic. While it may not always provide a perfect answer right away, it gets you closer, and faster, than traditional methods. 


This iterative process has proven to be a huge asset in modernization initiatives. It empowers teams to move forward with confidence, knowing they can efficiently extract the insights they need, even from complex legacy systems. The result? A smoother modernization journey with far fewer roadblocks I would say. 

 


Where does this leave COBOL? 


Although CoBot revealed itself as a powerful tool, it is important to acknowledge that this solution is not here to replace COBOL developers altogether. Instead, it significantly reduces the dependency on scarce COBOL expertise by acting as a powerful support tool. 


Developers can leverage the assistant to handle routine analysis and code explanation, allowing experienced COBOL professionals to focus on more complex, high-value tasks. This shift optimizes resources and eases the pressure of finding specialized COBOL talent. 

 


Can you spot the elephant in the room? 


That’s right - data privacy and compliance! Just how comfortable are financial institutions with letting their sensitive code run through cloud environments? The answer, as you probably guessed, is not very much, and in some cases, not at all. 


So, how do we tackle that challenge? Find out all about it in our latest article, where we explore the role of private LLMs and how they’re shaping the future of secure AI implementations in financial services (and how CoBot took advantage of them).


Feeling chatty? You can always extend the debate on this topic and contact Patrick Machado to present your perspective on how AI transforms old legacy systems.