期刊文献+
共找到2篇文章
< 1 >
每页显示 20 50 100
Automated pattern-directed refactoring for complex conditional statements
1
作者 刘伟 胡志刚 +1 位作者 刘宏韬 杨柳 《Journal of Central South University》 SCIE EI CAS 2014年第5期1935-1945,共11页
Complex conditional statement is one of the bad code smells, which affects the quality of the code and design of software. In the proposed approach, two commonly-used design patterns for handling complex conditional s... Complex conditional statement is one of the bad code smells, which affects the quality of the code and design of software. In the proposed approach, two commonly-used design patterns for handling complex conditional statements are selected, and they are the factory method pattern and the strategy pattem. Two pattern-directed refactoring approaches based on the two design patterns are proposed. Each approach contains a refactoring opportunities identification algorithm and an automated refactoring algorithm. After parsing the abstract syntax tree generated from source code, the refactoring opportunities are identified effectively and automatically. Then, for candidate code, refactoring algorithms are executed automatically, which are used to simplify or remove complex conditional statements. By empirical analysis and quality assessment, the code after refactoring has better maintainability and extensibility, and the proposed approach for automated pattern-directed refactoring succeeds to reduce code size and complexity of classes. 展开更多
关键词 refactoring abstract syntax tree complex conditional statements design patterns factory method pattem strategypattem
在线阅读 下载PDF
Identification of refactoring opportunities for source code based on class association relationships
2
作者 LIU Wei YANG Na +2 位作者 HUANG Xin-di HU Wei HU Zhi-gang 《Journal of Central South University》 SCIE EI CAS CSCD 2020年第12期3768-3778,共11页
In order to deal with the complex association relationships between classes in an object-oriented software system,a novel approach for identifying refactoring opportunities is proposed.The approach can be used to dete... In order to deal with the complex association relationships between classes in an object-oriented software system,a novel approach for identifying refactoring opportunities is proposed.The approach can be used to detect complex and duplicated many-to-many association relationships in source code,and to provide guidance for further refactoring.In the approach,source code is first transformed to an abstract syntax tree from which all data members of each class are extracted,then each class is characterized in connection with a set of association classes saving its data members.Next,classes in common associations are obtained by comparing different association classes sets in integrated analysis.Finally,on condition of pre-defined thresholds,all class sets in candidate for refactoring and their common association classes are saved and exported.This approach is tested on 4 projects.The results show that the precision is over 96%when the threshold is 3,and 100%when the threshold is 4.Meanwhile,this approach has good execution efficiency as the execution time taken for a project with more than 500 classes is less than 4 s,which also indicates that it can be applied to projects of different scales to identify their refactoring opportunities effectively. 展开更多
关键词 identification of refactoring opportunities abstract syntax tree class association relationships common association classes source code
在线阅读 下载PDF
上一页 1 下一页 到第
使用帮助 返回顶部