Variable Name Expansion for Reverse Engineering Legacy Code

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Reverse engineering of program code is complex due to the lack of specific syntactic rules for variable naming, leading to infinite variations and technical debt from multiple developers, making it difficult to understand and maintain legacy codes with cryptic variable names.

Innovation Solution

A system and method that uses multi-model based abbreviation expansion techniques, including parsing, segmentation, co-occurrence resolution, and conflict resolution, to identify meaningful terms in a domain context from cryptic variable names in program code, leveraging machine learning models to understand and expand variable names.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If multiple developers maintain legacy code with different naming conventions, then code functionality is preserved and adaptability is improved, but variable name clarity deteriorates and code complexity increases

Engineering Contradiction:
Improvecode adaptabilityVSAvoidcode complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary system that acts as a mediator between cryptic variable names and their meanings. This system uses machine learning models to expand abbreviations and resolve variable names to their full meanings, thereby reducing code complexity without changing the existing code structure or developer practices.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces manual code analysis and understanding (mechanical human effort) with automated machine learning-based abbreviation expansion systems. This substitution allows the system to automatically interpret cryptic variable names without requiring human developers to manually understand each abbreviation, thereby reducing code complexity.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If developers use cryptic abbreviations for variable names, then coding speed and productivity are improved, but code understandability deteriorates and reverse engineering complexity increases

Engineering Contradiction:
Improvecoding speedVSAvoidcode understandability
Core Design Contradiction:
ProductivityVSDifficulty of detecting and measuring

Solution Approach 1:

The system introduces an intermediary abbreviation expansion layer that sits between the cryptic variable names and the code understanding process. This intermediary uses trained machine learning models to automatically expand abbreviations like 'CUST_ID' to 'CUSTOMER ID' or 'ORD_DATE' to 'ORDER DATE', thereby maintaining coding speed while improving code understandability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent applies preliminary action by pre-training machine learning models on domain-specific terminology and naming conventions before they are used to expand abbreviations. This preliminary training enables the system to quickly and accurately expand abbreviations without requiring manual intervention, thus preserving coding speed while enhancing understandability.

Inventive Principle:
Principle #10Preliminary action

3Device complexity

If traditional code analysis methods are used, then simplicity of the system is maintained, but the ability to understand domain-specific cryptic terms deteriorates

Engineering Contradiction:
Improvesystem simplicityVSAvoidterm understanding accuracy
Core Design Contradiction:
Device complexityVSMeasurement precision

Solution Approach 1:

The patent changes the parameter of system complexity by introducing machine learning models that can be trained on domain-specific data. This allows the system to achieve high term understanding accuracy in domain-specific contexts while maintaining relative simplicity through modular model architecture and standardized processing pipelines.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system applies local quality by using domain-specific trained models for different codebases or project types. Each model is specialized for its domain (e.g., healthcare, finance, e-commerce), allowing high precision in understanding domain-specific cryptic terms while keeping the overall system structure simple and modular.

Inventive Principle:
Principle #3Local quality

Data Source

PatentEP4120072A1Method and system for identifying meaningful terms from cryptic forms of variable in program code
Publication Date: 2023.01.18 TATA CONSULTANCY SERVICES LTD
  • EP4120072A1 patent drawingFigure 1
  • EP4120072A1 patent drawingFigure 2
  • EP4120072A1 patent drawingFigure 3

AI summary

To understand / reverse engineer the code, knowledge of cryptic terms (variable names) present in the code is mandatory. The reverse engineering to understand the code is a very complex task which has infinite variations. The present disclosure provides a method and system for identifying meaningful terms in a domain context from a plurality of cryptic forms of a variable name in a program code. The present disclosure provides a machine learning model that understands the cryptic form of a variable name and relates the co-occurring cryptic terms and expands them. These expanded forms of cryptic terms directly aid in understanding of each term and its usage in a more accurate way. This knowledge is used in many downstream task of reverse engineering the program code. This disclosure links the multiple usages of the same variable and aims to reduce the gap of naming convention mismatches introduced by developers.