Skip to main content

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 656))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston (1995)

    MATH  Google Scholar 

  2. Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison Wesley, Boston (1999)

    Google Scholar 

  3. Kierevsky, J.: Refactoring to Patterns. Addison Wesley, Boston (2004)

    Book  Google Scholar 

  4. Mariani, T., Vergilio, S.R.: A systematic review on search-based refactoring. Inf. Softw. Technol. 83, 14–34 (2017)

    Article  Google Scholar 

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. 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)

    Article  Google Scholar 

  10. 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)

    Google Scholar 

  11. Christopoulou, A., Giakoumakis, E., Zafeiris, V.E., Soukara, V.: Automated refactoring to the strategy design pattern. Inf. Softw. Technol. 54, 1202–1214 (2012)

    Article  Google Scholar 

  12. Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20, 476–493 (1994)

    Article  Google Scholar 

  13. Kan, S.H.: Metrics and Models in Software Quality Engineering. Addison-Wesley, Boston (1998)

    MATH  Google Scholar 

  14. Bansiya, J., Davis, C.G.: A hierarchical model for object-oriented design quality assessment. IEEE Trans. Softw. Eng. 28(1), 4–17 (2002)

    Article  Google Scholar 

  15. Tsantalis, N., Chatzigeorgiou, A.: Identification of move method refactoring opportunities. IEEE Trans. Softw. Eng. 35(3), 347–367 (2009)

    Article  Google Scholar 

  16. 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)

    Google Scholar 

  17. 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)

    Chapter  Google Scholar 

  18. 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)

    Google Scholar 

  19. Tokuda, L., Batory, D.S.: Evolving object-oriented designs with refactorings. Autom. Softw. Eng. 8(1), 89–120 (2001)

    Article  MATH  Google Scholar 

  20. Sommerville, I.: Software Engineering, 10th edn. Pearson Education, New York (2015)

    MATH  Google Scholar 

  21. Eclipse - an open development platform. http://www.eclipse.org

  22. Cinneide, M.O.: Automated application of design patterns: a refactoring approach. Ph.D. thesis, University of Dublin, Trinity College (2001)

    Google Scholar 

  23. 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)

    Article  Google Scholar 

  24. 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)

    Google Scholar 

  25. Derezinska, A.: Metrics in software development and evolution with design patterns (to appear)

    Google Scholar 

Download references

Acknowledgments

The author thanks their student P. Saran for implementation of the plugins and evaluation of case studies.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Anna Derezińska .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics