IP Library Granted Patent US 10,705,809
Granted Patent B2
US 10,705,809 · App. 15/699,510 · Granted Jul 7, 2020

Pruning engine

Inventor: Tushar Makkar (Ambala, IN)
Assignee: DevFactory Innovations FZ-LLC
G06F8/36G06F8/33G06F8/71G06F8/72G06F8/75G06F8/77
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,705,809
App. No.
15/699,510
Granted
Jul 7, 2020
Kind
B2
Abstract

A method and apparatus are disclosed for enhancing operable functionality of input source code files from a software program by preprocessing input source code files with codeword processing operations to generate a plurality of preprocessed input source code files, identifying candidate code snippets by pruning one or more preprocessed input source code files that do not meet a similarity threshold measure for library functions stored in the system library, and identifying at least a first validated code snippet from the one or more candidate code snippets that matches a first library function stored in the system memory on the basis of at least first and second matching metrics.

Claims (58)

1. A method performed by a device having an operating system and a system library for enhancing operable functionality of a software program, comprising:

receiving, by the device, a plurality of input source code files from the software program submitted by a developer;

preprocessing each input source code file with a plurality of codeword processing operations selected from a group consisting of a stopword removal operation, a splitting operation, a stemming operation, a conversion operation, a semantic information addition operation, or a wordnet integration operation, thereby generating a plurality of preprocessed input source code files;

identifying, by the device, one or more candidate code snippets from the plurality of preprocessed input source code files by pruning one or more preprocessed input source code files, wherein pruning one or more preprocessed input source code files comprises:

generating a feature vector of each of the one or more preprocessed input source code files;

determining a candidate value for each of the one or more preprocessed input source code files by comparing the feature vector of each of the one or more preprocessed input source code files to a feature vector of each of multiple library functions stored in the system library; and

for each candidate value of the one or more preprocessed input source code files, determining if the candidate value exceeds a similarity threshold measure for the library functions; and

for each of the one or more preprocessed input source code files, pruning each preprocessed input source code files that does not meet a similarity threshold measure for library functions stored in the system library;

identifying, by the device, at least a first validated code snippet from the one or more candidate code snippets that matches a first library function stored in the system memory on the basis of at least first and second matching metrics, wherein identifying the first validated code snippet comprises performing machine learning and natural language processing in combination with code analysis techniques to implement an input/output matching algorithm for selecting a candidate code snippet which generates the same output as the first library function when both are injected with a shared input; and

presenting, to the developer, a library function recommendation comprising the first validated code snippet, the first library function, and instructions for replacing the first validated code snippet with the first library function.

2. The method of claim 1 , where identifying one or more candidate code snippets comprises:

performing natural language processing analysis of the plurality of preprocessed input source code files to extract input source code feature vectors; and

comparing the input source code feature vectors to library function feature vectors for library functions stored in the system library to identify at least a first candidate code snippet which meets at least a first similarity threshold measure for a first library function stored in the system library.

3. The method of claim 2 , where performing natural language processing analysis comprises employing one or more vector formation techniques selected from a group consisting of Latent Semantic Indexing, Latent Semantic Analysis, Latent Dirichlet Allocation, Rapid Automatic Keyword Extraction, and Term Frequency-Inverse Document Frequency.

4. The method of claim 2 , where performing natural language processing analysis comprises employing a weighted combination of Latent Dirichlet Allocation (LDA), Latent Semantic Analysis (LSA), and Rapid Automatic Keyword Extraction (RAKE) on the plurality of preprocessed input source code by giving more weightage to LDA, then LSA, and then RAKE.

5. The method of claim 2 , where comparing the input source code feature vectors comprises computing cosine similarity or dot product values between the input source code feature vectors and library function feature vectors.

6. The method of claim 2 , where comparing the input source code feature vectors comprises computing dot product values between the input source code feature vectors and library function feature vectors having a weightage set as 1.

7. The method of claim 1 , where identifying the first validated code snippet comprises performing machine learning and natural language processing in combination with code analysis techniques to implement a fuzzy matching algorithm for selecting a candidate code snippet having first internal extracted features that match second internal extracted features from the first library function.

8. A non-transitory, computer program product comprising at least one recordable medium having stored thereon executable instructions and data which, when executed by at least one processing device, cause the at least one processing device to:

receive a plurality of input source code files from the software program submitted by a developer;

preprocess each input source code file with a plurality of codeword processing operations selected from a group consisting of a stopword removal operation, a splitting operation, a stemming operation, a conversion operation, a semantic information addition operation, or a wordnet integration operation, thereby generating a plurality of preprocessed input source code files;

identify one or more candidate code snippets from the plurality of preprocessed input source code files by pruning one or more preprocessed input source code files, wherein pruning one or more preprocessed input source code files comprises:

generating a feature vector of each of the one or more preprocessed input source code files;

determining a candidate value for each of the one or more preprocessed input source code files by comparing the feature vector of each of the one or more preprocessed input source code files to a feature vector of each of multiple library functions stored in the system library; and

for each candidate value of the one or more preprocessed input source code files, determining if the candidate value exceeds a similarity threshold measure for the library functions; and

for each of the one or more preprocessed input source code files, pruning each preprocessed input source code files that does not meet a similarity threshold measure for library functions stored in the system library;

identify at least a first validated code snippet from the one or more candidate code snippets that matches a first library function stored in the system memory on the basis of at least first and second matching metrics, wherein to identify the first validated code snippet comprises performing machine learning and natural language processing in combination with code analysis techniques to implement an input/output matching algorithm for selecting a candidate code snippet which generates the same output as the first library function when both are injected with a shared input; and

present a library function recommendation comprising the first validated code snippet, the first library function, and instructions for replacing the first validated code snippet with the first library function.

9. The computer program product of claim 8 , wherein the computer readable program, when executed on the system, causes the at least one processing device to identify one or more candidate code snippets by:

performing natural language processing analysis of the plurality of preprocessed input source code files to extract input source code feature vectors; and

comparing the input source code feature vectors to library function feature vectors for library functions stored in the system library to identify at least a first candidate code snippet which meets at least a first similarity threshold measure for a first library function stored in the system library.

10. The computer program product of claim 9 , wherein the computer readable program, when executed on the system, causes the at least one processing device to perform natural language processing analysis by employing a weighted combination of Latent Dirichlet Allocation (LDA), Latent Semantic Analysis (LSA), and Rapid Automatic Keyword Extraction (RAKE) on the plurality of preprocessed input source code by giving more weightage to LDA, then LSA, and then RAKE.

11. The computer program product of claim 9 , wherein the computer readable program, when executed on the system, causes the at least one processing device to compare the input source code feature vectors by computing cosine similarity or dot product values between the input source code feature vectors and library function feature vectors.

12. The computer program product of claim 9 , wherein the computer readable program, when executed on the system, causes the at least one processing device to compare the input source code feature vectors by computing dot product values between the input source code feature vectors and library function feature vectors having a weightage set as 1.

13. The computer program product of claim 8 , wherein the computer readable program, when executed on the system, causes the at least one processing device to identify the first validated code snippet by performing machine learning and natural language processing in combination with code analysis techniques to implement a fuzzy matching algorithm for selecting a candidate code snippet having first internal extracted features that match second internal extracted features from the first library function.

14. A system comprising:

one or more processors;

a memory coupled to at least one of the processors; and

a set of instructions stored in the memory and executed by at least one of the processors to enhance operable functionality of a software program by recommending library substitutions for input source code files submitted by a developer, wherein the set of instructions are executable to perform actions of:

receiving a plurality of input source code files from the software program submitted by a developer;

preprocessing each input source code file with a plurality of codeword processing operations selected from a group consisting of a stopword removal operation, a splitting operation, a stemming operation, a conversion operation, a semantic information addition operation, or a wordnet integration operation, thereby generating a plurality of preprocessed input source code files;

identifying one or more candidate code snippets from the plurality of preprocessed input source code files by pruning one or more preprocessed input source code files, wherein pruning one or more preprocessed input source code files comprises:

generating a feature vector of each of the one or more preprocessed input source code files;

determining a candidate value for each of the one or more preprocessed input source code files by comparing the feature vector of each of the one or more preprocessed input source code files to a feature vector of each of multiple library functions stored in the system library; and

for each candidate value of the one or more preprocessed input source code files, determining if the candidate value exceeds a similarity threshold measure for the library functions; and

for each of the one or more preprocessed input source code files, pruning each preprocessed input source code files that does not meet a similarity threshold measure for library functions stored in the system library;

identifying at least a first validated code snippet from the one or more candidate code snippets that matches a first library function stored in the system memory on the basis of at least first and second matching metrics, wherein identifying the first validated code snippet comprises performing machine learning and natural language processing in combination with code analysis techniques to implement an input/output matching algorithm for selecting a candidate code snippet which generates the same output as the first library function when both are injected with a shared input; and

presenting a library function recommendation comprising the first validated code snippet, the first library function, and instructions for replacing the first validated code snippet with the first library function.

15. The system of claim 14 , where identifying one or more candidate code snippets comprises:

performing natural language processing analysis of the plurality of preprocessed input source code files to extract input source code feature vectors by employing one or more vector formation techniques selected from the group consisting of Latent Semantic Indexing, Latent Semantic Analysis, Latent Dirichlet Allocation, Rapid Automatic Keyword Extraction, and Term Frequency-Inverse Document Frequency; and

comparing the input source code feature vectors to library function feature vectors for library functions stored in the system library by computing cosine similarity or dot product values between the input source code feature vectors and library function feature vectors to identify at least a first candidate code snippet which meets at least a first similarity threshold measure for a first library function stored in the system library.

16. The system of claim 15 , where comparing the input source code feature vectors comprises computing dot product values between the input source code feature vectors and library function feature vectors having a weightage set as 1.

17. The system of claim 14 , where identifying the first validated code snippet comprises performing machine learning and natural language processing in combination with code analysis techniques to implement a fuzzy matching algorithm for selecting a candidate code snippet having first internal extracted features that match second internal extracted features from the first library function.

18. The method of claim 1 , where identifying one or more candidate code snippets comprises:

performing natural language processing analysis of the plurality of preprocessed input source code files to extract input source code feature vectors; and

comparing the input source code feature vectors to library function feature vectors for library functions stored in the system library to identify at least a first candidate code snippet which meets at least a first similarity threshold measure for a first library function stored in the system library.

19. The system of claim 18 , where performing natural language processing analysis comprises employing a weighted combination of Latent Dirichlet Allocation (LDA), Latent Semantic Analysis (LSA), and Rapid Automatic Keyword Extraction (RAKE) on the plurality of preprocessed input source code by giving more weightage to LDA, then LSA, and then RAKE.

20. The system of claim 18 , where comparing the input source code feature vectors comprises computing cosine similarity or dot product values between the input source code feature vectors and library function feature vectors.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 27, 2020
From: DEVFACTORY FZ-LLC
To: GTEAM FZ-LLC
Reel/Frame 051634/0970 →
CHANGE OF NAME Recorded Jan 27, 2020
From: GTEAM FZ-LLC
To: DEVFACTORY INNOVATIONS FZ-LLC
Reel/Frame 051713/0369 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 8, 2017
From: MAKKAR, TUSHAR
To: DEVFACTORY FZ-LLC
Reel/Frame 043792/0406 →
Continuity (1)
Related Publication 20190079741A1 · Mar 14, 2019
Cited By (3)
US 12,307,247 US 12,314,263 US 12,675,484