近三十年来,语言学理论发展的速度令学术界叹为观止。语言学宗们为了解释人的语言能力,人的语言直觉,提出种种静形态模式(formal static models)。人们为什么会接受下列各句(1a—7a),而不接受(1b—3b)句子?(1a)The little girl with blu...近三十年来,语言学理论发展的速度令学术界叹为观止。语言学宗们为了解释人的语言能力,人的语言直觉,提出种种静形态模式(formal static models)。人们为什么会接受下列各句(1a—7a),而不接受(1b—3b)句子?(1a)The little girl with blue eyes is making a mud pie.(2a)The student has taken the book away.展开更多
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.展开更多
文摘近三十年来,语言学理论发展的速度令学术界叹为观止。语言学宗们为了解释人的语言能力,人的语言直觉,提出种种静形态模式(formal static models)。人们为什么会接受下列各句(1a—7a),而不接受(1b—3b)句子?(1a)The little girl with blue eyes is making a mud pie.(2a)The student has taken the book away.
文摘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.