Title of article :
Automated refactoring to the Strategy design pattern
Author/Authors :
Christopoulou، نويسنده , , Aikaterini and Giakoumakis، نويسنده , , E.A. and Zafeiris، نويسنده , , Vassilis E. and Soukara، نويسنده , , Vasiliki، نويسنده ,
Issue Information :
ماهنامه با شماره پیاپی سال 2012
Abstract :
Context
tomated identification of code fragments characterized by common design flaws (or “code smells”) that can be handled through refactoring, fosters refactoring activities, especially in large code bases where multiple developers are engaged without a detailed view on the whole system. Automated refactoring to design patterns enables significant contributions to design quality even from developers with little experience on the use of the required patterns.
ive
ork targets the automated identification of refactoring opportunities to the Strategy design pattern and the elimination through polymorphism of respective “code smells” that are related to extensive use of complex conditional statements.
orithm is introduced for the automated identification of refactoring opportunities to the Strategy design pattern. Suggested refactorings comprise conditional statements that are characterized by analogies to the Strategy design pattern, in terms of the purpose and selection mode of strategies. Moreover, this work specifies the procedure for refactoring to Strategy the identified conditional statements. For special cases of these statements, a technique is proposed for total replacement of conditional logic with method calls of appropriate concrete Strategy instances. The identification algorithm and the refactoring procedure are implemented and integrated in the JDeodorant Eclipse plug-in. The method is evaluated on a set of Java projects, in terms of quality of the suggested refactorings and run-time efficiency. The relevance of the identified refactoring opportunities is verified by expert software engineers.
s
entification algorithm recalled, from the projects used during evaluation, many of the refactoring candidates that were identified by the expert software engineers. Its execution time on projects of varying size confirmed the run-time efficiency of this method.
sion
oposed method for automated refactoring to Strategy contributes to simplification of conditional statements. Moreover, it enhances system extensibility through the Strategy design pattern.
Keywords :
Polymorphism , Strategy pattern , Refactoring , Total replacement of conditional logic , design patterns
Journal title :
Information and Software Technology
Journal title :
Information and Software Technology