-
公开(公告)号:US20180336018A1
公开(公告)日:2018-11-22
申请号:US15596077
申请日:2017-05-16
发明人: Liang KS Lu , Teng Sun , Zhong Shi Wang , Zhe LI Yu
IPC分类号: G06F9/44
摘要: The present invention is a system and method for template extraction based on source code similarity. The system receives source code and groups the class files into classes based on naming rules and inheritance hierarchy. Features are parsed for each class and encoded a float value. The classes are clustered based on similarities of the features. A similarity value is calculated for the classes in a cluster and potential candidate classes are selected based on the similarity value or inheritance hierarchy. A feature subset is selected across all candidate classes and differences in the features in the subset are determined. The features are then decoded and the differences are parameterized to generate a template. A variable definition file is created to cross-reference features and variables. Source code can then be generated using the template and the variable definition file.