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.展开更多
Development of miniaturized three-dimensional(3 D)fliers with integrated functional components has important implications to a diverse range of engineering areas.Among the various active and passive miniaturized 3 D f...Development of miniaturized three-dimensional(3 D)fliers with integrated functional components has important implications to a diverse range of engineering areas.Among the various active and passive miniaturized 3 D fliers reported previously,a class of 3 D electronic fliers inspired by wind-dispersed seeds show promising potentials,owing to the lightweight and noiseless features,aside from the stable rotational fall associated with a low falling velocity.While on-demand shape-morphing capabilities are essential for those 3 D electronic fliers,the realization of such miniaturized systems remains very challenging,due to the lack of fast-response 3 D actuators that can be seamlessly integrated with 3 D electronic fliers.Here we develop a type of morphable3 D mesofliers with shape memory polymer(SMP)-based electrothermal actuators,capable of large degree of actuation deformations,with a fast response(e.g.,~1 s).Integration of functional components,including sensors,controllers,and chip batteries,enables development of intelligent 3 D mesoflier systems that can achieve the on-demand unfolding,triggered by the processing of real-time sensed information(e.g.,acceleration and humidity data).Such intelligent electronic mesofliers are capable of both the low-air-drag rising and the low-velocity falling,and thereby,can be used to measure the humidity fields in a wide 3 D space by simple hand throwing,according to our demonstrations.The developed electronic mesofliers can also be integrated with other types of physical/chemical sensors for uses in different application scenarios.展开更多
文摘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.
基金support from the National Natural Science Foundation of China(12050004 and 11921002)the Tsinghua National Laboratory for Information Science and Technology,and a grant from the Institute for Guo Qiang,Tsinghua University(2019GQG1012)+3 种基金support from the National Natural Science Foundation of China(11902178)the Natural Science Foundation of Beijing Municipality(3204043)China Postdoctoral Science Foundation(2019M650648)support from the National Natural Science Foundation of China(61904095)。
文摘Development of miniaturized three-dimensional(3 D)fliers with integrated functional components has important implications to a diverse range of engineering areas.Among the various active and passive miniaturized 3 D fliers reported previously,a class of 3 D electronic fliers inspired by wind-dispersed seeds show promising potentials,owing to the lightweight and noiseless features,aside from the stable rotational fall associated with a low falling velocity.While on-demand shape-morphing capabilities are essential for those 3 D electronic fliers,the realization of such miniaturized systems remains very challenging,due to the lack of fast-response 3 D actuators that can be seamlessly integrated with 3 D electronic fliers.Here we develop a type of morphable3 D mesofliers with shape memory polymer(SMP)-based electrothermal actuators,capable of large degree of actuation deformations,with a fast response(e.g.,~1 s).Integration of functional components,including sensors,controllers,and chip batteries,enables development of intelligent 3 D mesoflier systems that can achieve the on-demand unfolding,triggered by the processing of real-time sensed information(e.g.,acceleration and humidity data).Such intelligent electronic mesofliers are capable of both the low-air-drag rising and the low-velocity falling,and thereby,can be used to measure the humidity fields in a wide 3 D space by simple hand throwing,according to our demonstrations.The developed electronic mesofliers can also be integrated with other types of physical/chemical sensors for uses in different application scenarios.