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.展开更多
The growing complexity of System on Chip (SOC) requres a system level specicanon and design approach. High-level languages such as C++/SystemC can play multiple roles in system design as target languages. There ar...The growing complexity of System on Chip (SOC) requres a system level specicanon and design approach. High-level languages such as C++/SystemC can play multiple roles in system design as target languages. There are many practical problems in the application of object-oriented methods for this goal. Based on the analysis of traditional and system-level design methodology, a new object-oriented SOC design methodology with object-oriented design patterns is proposed, which emphasizes high-level design and verification. Aiming at the final goal of developing design patterns specific to SOC design, the reuse of design patterns in SOC systems and the capability of new SOC design patterns are discussed. With the illustration of some concrete examples of SOC design patterns, the application of object-oriented design methodology in the SOC design process is presented.展开更多
文摘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.
文摘The growing complexity of System on Chip (SOC) requres a system level specicanon and design approach. High-level languages such as C++/SystemC can play multiple roles in system design as target languages. There are many practical problems in the application of object-oriented methods for this goal. Based on the analysis of traditional and system-level design methodology, a new object-oriented SOC design methodology with object-oriented design patterns is proposed, which emphasizes high-level design and verification. Aiming at the final goal of developing design patterns specific to SOC design, the reuse of design patterns in SOC systems and the capability of new SOC design patterns are discussed. With the illustration of some concrete examples of SOC design patterns, the application of object-oriented design methodology in the SOC design process is presented.