arrow
返回

Automated pattern-directed refactoring for complex conditional statements

delete2014-05-15
delete5
PRE
AI
刘玮 封面图
刘玮 (Wei Liu)
Z
Zhigang Hu *
刘洪涛 (Hongtao Liu)
Y
Yang Liu
DOI:10.1007/s11771-014-2140-zdelete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
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 pattern. 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.
Keyword:
refactoring
abstract syntax tree
complex conditional statements
design patterns
factory method pattern
strategy pattern

期刊

Journal of Central South University 封面图
Journal of Central South University
IF:
4.4
论文数:
5.2K
被引数:
1.0W

机构

C
Central South University
学者数:
10.0W
论文数: 7.2W
被引数: 10.9W
引用论文

引用论文

err分享
err收藏
Automated refactoring to the Strategy design pattern
err2012-11-01
err29
PREAI
errChristopoulou, Aikaterini; Giakoumakis, E. A.; Zafeiris, Vassilis E.; Soukara, Vasiliki
err分享
err收藏
学者 查看更多内容