Resources
/
Case Study

Case Study: Code Explainer

Legacy System: Insurance system framework operated by global IT services company.

As-is State: 220 KLOC Java which was generated by some tool from an original COBOL program. The translated code was unmaintainable.

Target State: Understand the architecture, control flow, and data flow of the translated system to allow conversion into clear and maintainable code.

Challenges

  • The Java code that had been generated by tool translation from COBOL had completely intertwined features, enormously large screen classes, fixed-length arrays were used to represent database objects, fixed-position parameter passing was deployed, COBOL goto control structures were emulated through a complex exception scheme, and all data structures resided in emulated COBOL memory.
  • Variable and method names have been derived from cryptic COBOL names and all comment had been removed by translation tool.

Outcomes

  • Automatically created design documentation using the Code Explainer: The behavioral flow graphs clearly exhibit all computation paths through the system and where external resources such as databases or other programs are accessed. The data lineage graphs show how data is passed through the system and is transformed during computation.
  • Generated metrics suggest areas to focus rework based on data and resource dependencies.
  • AI-driven feature identification pointed to where important computational steps were being performed and allow for their systematic and precise replacement.
  • Replication analysis identified similarities in the generated code and allowed extraction of such code patterns into reused methods.
  • Based on the clear documentation created by the Code Explainer, custom automated transformations were implemented which reengineered the code by eliminating confusing program control derived from COBOL goto statements, replacing the emulated memory types by Java native types, replacing the emulated paragraph calls by native Java method calls, and leverage extracted design patterns for clarifying code. Overall system complexity was reduced by 18% and feature diffusion was reduced by 16%.