Patent ID: 11900104
Assignee: VFUNCTION, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A method for identifying and removing a dead-code from a computer program of an independent service, comprising:
retrieving information related to a code of a service, wherein the retrieved information includes at least static and dynamic dependencies information of classes of the service;
constructing a static dependencies graph, wherein nodes of the static dependencies graph are classes, and directed edges depict static dependencies between classes;
classifying classes based on the static dependencies;
constructing a first subgraph to include classes classified as internal-pure-static (IPS) classes, wherein the IPS classes includes two level of pure-static (PS) dependencies;
detecting at least one external-dead-class candidates by traversing the first subgraph for a set of reachable IPS classes, wherein detecting further comprises:
constructing a second subgraph, wherein the second subgraph includes the IPS classes designated in the first subgraph and at least one external-pure-static (EPS) class having dependency on the IPS classes;
generating the set of reachable IPS classes from the IPS classes of the first subgraph; and
determining the at least one EPS class as the at least one external-dead-class candidate when a number of classes in the set of reachable IPS classes is greater than a preconfigured threshold value;

adding the detected at least one external-dead-class candidates to a dead code cut (DCC) set;
removing at least one class included in the DCC set from the code of the service in order to create a reduced code of the service; and
causing an execution of the computer program via a processor using the reduced code of the service, thereby improving efficiency and security of the computer program.