# US 2023/0057636 A1 · Method and system for identifying terms from cryptic forms of variable names in program code

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0057636 A1
- Document ID: US20230057636A1
- Status: Published application
- Kind: A1
- Application number: 17/810,452
- Filed: 2022-07-01
- Published: 2023-02-23
- Earliest claimed: 2021-07-15
- Assignees: Tata Consultancy Services Limited
- Applicants: Tata Consultancy Services Limited
- Inventors: YOGANANDA RAVINDRANATH; TAMILDURAI MEHALINGAM; RESHINTH GNANA ADITHYAN; MOUNICA THAMATAM REDDY; ADITYA THURUVAS SENTHIL; SHRAYAN BANERJEE
- Web page: https://patentgrep.com/patent/US20230057636A1

## CPC

- G06F 8/74: Reverse engineering; Extracting design information from source code
- G06F 9/44: Arrangements for executing specific programs
- G06F 40/274: Converting codes to words; Guess-ahead of partial word inputs
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

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.

## Claims

### Claim 1

A processor implemented method for identifying meaningful terms in a domain context from a plurality of cryptic forms of a variable name in a program code, the method comprising:
providing, via a user interface, the program code as an input, wherein the program code comprises the plurality of cryptic forms of the variable name;
extracting, via one or more hardware processors, the variable name from the program code using a parsing technique;
segmenting, via the one or more hardware processors, the variable name into a major entity and a plurality of sub-entities using a plurality of segmentation techniques;
obtaining, via the one or more hardware processors, a plurality of expansions of the major entity and the plurality of expansions of the plurality of sub-entities of the variable name using a plurality of multi-model based abbreviation expansion techniques;
regrouping, via the one or more hardware process, the obtained plurality of expansions of the major entity and the plurality of sub-entities which are co-occurring in the program code to obtain a plurality of suggestions of terms;
performing, via the one or more hardware processor, a co-occurrence resolution of the plurality of suggestion of terms to check whether the plurality of suggested terms make sense in the program code, wherein the co-occurrence resolution results in the generation of one or more expansions of the terms; and
performing, via the one or more hardware processors, a conflict resolution if there are more than one expansion of the terms, to identify a meaningful term of the abbreviation of the variable name according to a current context.

### Claim 2 (depends on 1)

The processor implemented method of claim 1, wherein the conflict resolution is performed using one of:
(i) using a set of domain specific trained models and a word2vec model on trained domains give a vector space of the words individually and then the distance is calculated between words, for providing/generating a vector space of the words individually and calculating distance between words,
(ii) using a co-occurrence model generated using keyword extraction logic according to which the entity occurring together have higher probability to come together than other words, and
(iii) using a custom windowing logic developed based on words co-occurring together to go through a corpus to determine words occurring together and assigning probability to the words that are to be expanded.

### Claim 3 (depends on 1)

The processor implemented method of claim 1, wherein the multi-model based abbreviation resolution is performed based on one or more of the following methods:
a syllable based abbreviation prediction,
a first n term abbreviation,
an insignificant character remover,
a variable relations with other variables based prediction,
an acronym identification and expansion, and
a random generator.

### Claim 4 (depends on 2)

The processor implemented method of claim 2 further comprising manually assigning abbreviation to the terms according to the preference of a user to decide the first method to resolve the abbreviation.

### Claim 5 (depends on 1)

The processor implemented method of claim 1 further comprising receiving feedback from the user to determine the correct expansion and saving for future use.

### Claim 6 (depends on 1)

The processor implemented method of claim 1, wherein the segmentation is done based on hyphen, based on underscore, based on case of the term or using a word segmentation technique, wherein the word segmentation technique is based on the knowledge from mapping the variable names to variable based comments, version based comments, and overview based comments extracted from code.

### Claim 7

A system for identifying meaningful terms in a domain context from a plurality of cryptic forms of a variable name in a program code, the system comprises:
a user interface for receiving the program code as an input, wherein the program code comprises the plurality of cryptic forms of the variable name;
one or more hardware processors;
a memory in communication with the one or more hardware processors, wherein the one or more first hardware processors are configured to execute programmed instructions stored in the one or more first memories, to:
extract the variable name from the program code using a parsing technique;
segment the variable name into a major entity and a plurality of sub-entities using a plurality of segmentation techniques;
obtain a plurality of expansions of the major entity and the plurality of expansions of the plurality of sub-entities of the variable name using a plurality of multi model based abbreviation expansion techniques;
regroup the obtained plurality of expansions of the major entity and the plurality of sub-entities which are co-occurring in the program code to obtain a plurality of suggestions of terms;
perform a co-occurrence resolution of the plurality of suggested terms to check whether the plurality of suggestions of terms make sense in the program code, wherein the co-occurrence resolution results in the generation of one or more expansions of the terms; and
perform a conflict resolution if there are more than one expansion of the terms, to identify a meaningful term of the abbreviation of the variable name according to a current context.

### Claim 8 (depends on 7)

The system of claim 7, wherein the conflict resolution is performed using one of the following:
(iv) using a set of domain specific trained models and a word2vec model on trained domains give a vector space of the words individually and then the distance is calculated between words, for providing/generating a vector space of the words individually and calculating distance between words,
(v) using a co-occurrence model generated using keyword extraction logic according to which the entity occurring together have higher probability to come together than other words, and
(vi) using a custom windowing logic developed based on words co-occurring together to go through a corpus to determine words occurring together and assigning probability to the words that are to be expanded.

### Claim 9 (depends on 7)

The system of claim 7, wherein the multi-model based abbreviation resolution is performed based on one or more of the following methods:
a syllable based abbreviation prediction,
a first n term abbreviation,
an insignificant character remover,
a variable relations with other variables based prediction,
an acronym identification and expansion, and
a random generator.

### Claim 10 (depends on 7)

The system of claim 7 further configured to manually assign abbreviation to the terms according to the preference of a user to decide the first method to resolve the abbreviation.

### Claim 11 (depends on 7)

The system of claim 7 further configured to receive feedback from the user to determine the correct expansion and saving for future use.

### Claim 12

One or more non-transitory machine-readable information storage mediums comprising one or more instructions which when executed by one or more hardware processors cause:
providing, via a user interface, the program code as an input, wherein the program code comprises the plurality of cryptic forms of the variable name;
extracting, the variable name from the program code using a parsing technique;
segmenting, via the one or more hardware processors, the variable name into a major entity and a plurality of sub-entities using a plurality of segmentation techniques;
obtaining, via the one or more hardware processors, a plurality of expansions of the major entity and the plurality of expansions of the plurality of sub-entities of the variable name using a plurality of multi-model based abbreviation expansion techniques;
regrouping, via the one or more hardware process, the obtained plurality of expansions of the major entity and the plurality of sub-entities which are co-occurring in the program code to obtain a plurality of suggestions of terms;
performing, via the one or more hardware processor, a co-occurrence resolution of the plurality of suggestion of terms to check whether the plurality of suggested terms make sense in the program code, wherein the co-occurrence resolution results in the generation of one or more expansions of the terms; and
performing, via the one or more hardware processors, a conflict resolution if there are more than one expansion of the terms, to identify a meaningful term of the abbreviation of the variable name according to a current context.
