Abstract
Design patterns can be introduced into an existing code by a code restructuring. It is counted to one of goals of code refactoring. This paper presents a process that automates this kind of refactoring. The approach is based on a structural code analysis aimed at design pattern relevance. The process consists of three main phases: code analysis, determination of a refactoring range, and realization of code restructuring. The latter is a complex code2code transformation, which comprises a series of code refactoring steps. A decision about a range of a design pattern application is taken by a user or can be automated. In both cases, it is supported by a software relevance metric. A framework for the whole process has been implemented as an extension of Eclipse. Code refactoring to exemplary design patterns can be performed in a prototype tool for Java programs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston (1995)
Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison Wesley, Boston (1999)
Kierevsky, J.: Refactoring to Patterns. Addison Wesley, Boston (2004)
Mariani, T., Vergilio, S.R.: A systematic review on search-based refactoring. Inf. Softw. Technol. 83, 14–34 (2017)
Amoui, M., Mirarab, S., Ansari, S., Lucas, C.: A genetic algorithm approach to design evolution using design pattern transformation. Int. J. Inf. Technol. Intell. Comput. 1, 235–244 (2006)
Jensen, A.C., Cheng, B.H.: On the use of genetic programming for automated refactoring and the introduction of design patterns. In: Genetic and Evolutionary Computation Conference (GECCO), pp. 1341–1348. ACM (2010)
Shimomura, T., Ikeda, K., Takahashi, M.: An approach to GA-driven automatic refactoring based on design patterns. In: 5th International Conference on Software Engineering Advances (ICSEA), pp. 213–218 (2010)
Kim, J., Batory, D., Dig, D.: Scripting parametric refactorings in Java to retrofit design patterns. In: 31st IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 211–220. IEEE (2015)
Gaitani, M.A.G., Zafeiris, V.E., Diamantidis, N.A., Giakoumakis, E.A.: Automated refactoring to the null object design pattern. Inf. Softw. Technol. 59, 33–52 (2015)
Jeon, S.-U., Lee, J.-S. Bae, D.-H: An automated refactoring approach to design pattern-based program transformations in Java programs. In: Proceedings of Ninth Asia-Pacific Software Engineering Conference (APSEC 2002), pp. 337–345. IEEE Computer Society (2002)
Christopoulou, A., Giakoumakis, E., Zafeiris, V.E., Soukara, V.: Automated refactoring to the strategy design pattern. Inf. Softw. Technol. 54, 1202–1214 (2012)
Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20, 476–493 (1994)
Kan, S.H.: Metrics and Models in Software Quality Engineering. Addison-Wesley, Boston (1998)
Bansiya, J., Davis, C.G.: A hierarchical model for object-oriented design quality assessment. IEEE Trans. Softw. Eng. 28(1), 4–17 (2002)
Tsantalis, N., Chatzigeorgiou, A.: Identification of move method refactoring opportunities. IEEE Trans. Softw. Eng. 35(3), 347–367 (2009)
Silva, D., Terra, R., Valente, M.T.: Recommending automated extract method refactorings. In: 22nd International Conference on Program Comprehension (ICPC), pp. 146–156. ACM, New York (2014)
Bavota, G., Lucia, A.D., Marcus, A., Oliveto, R.: Recommending refactoring operations in large software systems. In: Robillard, M.P., Maalej, W., Walker, R.J., Zimmermann, T. (eds.) Recommendation Systems in Software Engineering (RSSE), pp. 387–419. Springer, Berlin (2014)
Vakilian, M., Chen, N., Negara, S., Rajkumar, B.A., Bailey, B.P., Johnson, R.E.: Use, disuse, and misuse of automated refactorings. In: 34th International Conference on Software Engineering (ICSE), pp. 233–243 (2012)
Tokuda, L., Batory, D.S.: Evolving object-oriented designs with refactorings. Autom. Softw. Eng. 8(1), 89–120 (2001)
Sommerville, I.: Software Engineering, 10th edn. Pearson Education, New York (2015)
Eclipse - an open development platform. http://www.eclipse.org
Cinneide, M.O.: Automated application of design patterns: a refactoring approach. Ph.D. thesis, University of Dublin, Trinity College (2001)
Mayvan, B.B., Rasoolzadegan, A., Yazdi, Z.G.: The state of the art on design patterns: a systematic mapping of the literature. J. Syst. Softw. 125, 93–118 (2017)
Abbe, M., Yoo, C.-J.: Trends, opportunities and challenges of software refactoring: a systematic literature review. Int. J. Softw. Eng. Appl. 8(6), 299–318 (2014)
Derezinska, A.: Metrics in software development and evolution with design patterns (to appear)
Acknowledgments
The author thanks their student P. Saran for implementation of the plugins and evaluation of case studies.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG
About this paper
Cite this paper
Derezińska, A. (2018). A Structure-Driven Process of Automated Refactoring to Design Patterns. In: Świątek, J., Borzemski, L., Wilimowska, Z. (eds) Information Systems Architecture and Technology: Proceedings of 38th International Conference on Information Systems Architecture and Technology – ISAT 2017. ISAT 2017. Advances in Intelligent Systems and Computing, vol 656. Springer, Cham. https://doi.org/10.1007/978-3-319-67229-8_4
Download citation
DOI: https://doi.org/10.1007/978-3-319-67229-8_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-67228-1
Online ISBN: 978-3-319-67229-8
eBook Packages: EngineeringEngineering (R0)