COBOL, a language over six decades old and mainly engineered by retired or deceased architects, still underpins hundreds of billions of lines of code in global production systems. IBM, keen on preserving these legacy functions on its Z mainframe systems, has embarked on an ambitious endeavor: rewriting this extensive COBOL codebase in Java. A few years ago, humans were tasked with this colossal undertaking, but now IBM is turning to AI to expedite the process.

Enter the IBM Watsonx Code Assistant, slated for release in Q4 of this year. This innovative tool aims to keep human expertise in the loop while leveraging generative AI to analyze, refactor, and test the new object-oriented code. Importantly, it’s not an all-or-nothing approach; IBM asserts that code generated by Watsonx should seamlessly interoperate with COBOL and specific Z mainframe functions.

In a technical blog post dedicated to COBOL conversion, Kyle Charlet, CTO for zSystems software at IBM, echoes the sentiments of many regarding COBOL: it’s not just about the code itself; it’s about the intricate business logic, the handling of edge cases, and the institutional memory, or often the lack thereof.

IBM’s Watsonx, as Charlet elaborates, could assist large organizations in disentangling individual services from monolithic COBOL applications. IBM envisions this process unfolding in three phases:

  1. Refactor: This initial step involves surgically separating or extracting individual services from the larger codebase.
  2. Transform: Next, the code is transformed into mainframe-friendly Java or COBOL that can seamlessly communicate with Java.
  3. Validate: Here, AI plays a pivotal role in generating test cases, although human coders remain firmly “in the driver’s seat.”

AI assistance appears poised to tackle the daunting challenge of modernizing COBOL while ensuring its continued functionality. While COBOL codebases tend to be stable and secure, the costs associated with updating and extending them are astronomical. Legacy COBOL was even implicated in the 2015 Office of Personnel Management breach, highlighting its incompatibility with encryption and modern secure systems.

Yet, there’s an ongoing argument that COBOL excels at managing business-specific systems and transactions with fewer potential attack vectors. Alternatively, some contend that AI-generated and restructured code may appear correct and test-ready, but without the deep institutional knowledge of human experts, AI-enhanced code might contain as many uncertainties as AI-enhanced content.

IBM’s Watsonx Code Assistant for Z is set to make its next appearance with Red Hat Ansible Light speed. With Watsonx.ai purportedly trained on over 100 coding languages, it’s likely that more AI co-pilots for legacy mainframe code will emerge in the near future.

By Impact Lab