- 专利标题: Method and system for template extraction based on source code similarity
-
申请号: US15596077申请日: 2017-05-16
-
公开(公告)号: US10296307B2公开(公告)日: 2019-05-21
- 发明人: Liang K S Lu , Teng Sun , Zhong Shi Wang , Zhe Li Yu
- 申请人: International Business Machines Corporation
- 申请人地址: US NY Armonk
- 专利权人: International Business Machines Corporation
- 当前专利权人: International Business Machines Corporation
- 当前专利权人地址: US NY Armonk
- 代理机构: Bond Schoeneck & King, PLLC
- 代理商 George R. McGuire; John Pivnichny
- 主分类号: G06F8/36
- IPC分类号: G06F8/36 ; G06F8/70
摘要:
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.
公开/授权文献
信息查询