返回
Automated pattern-directed refactoring for complex conditional statements
DOI:10.1007/s11771-014-2140-z.png)
摘要
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
期刊
IF:
4.4
论文数:
5.2K
被引数:
1.0W
机构
引用论文
Identification of extract method refactoring opportunities for the decomposition of methods识别方法分解的提取方法重构机会
Identifying Extract Class refactoring opportunities using structural and semantic cohesion measures使用结构和语义内聚性度量来识别提取类重构机会
A 1-V Supply a-InGaZnO-Based Voltage Reference With Enhancement- and Depletion-Mode Thin-Film Transistors具有增强和耗尽模式薄膜晶体管的基于1-V电源的基于InGaZnO的电压基准

