Method and System for Arbitrary-Granularity Execution Clone Detection
AssigneeDevFactory FZ-LLC
InventorTushar Makkar
Life of this patent
Estimating the term…
Abstract
A method and apparatus are disclosed for enhancing operable functionality of input source code files from a software program by identifying a first code snippet and a first library function which have similar execution flow similarity measures by evaluating a first contiguous sequence of n items extracted from the first code snippet against a second contiguous sequence of n items extracted from the first library function using an Ngram threshold that is calculated for the first library function and one or more literals from the first code snippet so that the developer is presented with a library function recommendation which includes the first code snippet, the first library function, and instructions for replacing the first code snippet with the first library function.
Claims2
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;
- identifying, by the device, one or more candidate code snippets from the plurality of input source code files;
- identifying, by the device, at least a first candidate code snippet and a first library function which have similar execution flow similarity measures by evaluating a first contiguous sequence of n items extracted from the first code snippet against a second contiguous sequence of n items extracted from the first library function using an Ngram threshold that is calculated for the first library function and one or more literals from the first code snippet;
- and
- presenting, to the developer, a library function recommendation comprising the first code snippet, the first library function, and instructions for replacing the first code snippet with the first library function.
-8. (canceled)
Dependencies are inferred from the claim text.