Abstract
Refactoring is an essential agile practice; microservices are a currently trending implementation approach for service-oriented architectures. While program-internal code refactoring is well established, refactoring components on the architectural level has been researched but not adopted widely in practice yet. Hence, refactoring service Application Programming Interfaces (APIs) is not understood well to date. As a consequence, practitioners struggle with the evolution of APIs exposed by microservices. To overcome this problem, we propose to switch the refactoring perspective from implementation to integration and study how refactorings can be applied to the problem domain of agile service API design and evolution. We start with an empirical analysis and assessment of the state of the art and the practice. The contributions of this paper then are: 1) presentation of results from a practitioner survey on API change and evolution, 2) definitions for a future practice of API refactoring and 3) a candidate catalog of such API refactorings. We discuss these contributions and propose a research action plan as well.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
One might argue that this violates the original definition of refactoring because the observable behavior is clearly and deliberately changed. In the refactoring example given earlier, a local variable is renamed, making it unlikely that the observable behavior of the software changes. But refactorings involving multiple classes, for example moving a method from one class to another, change the interfaces of these classes – possibly including public ones – in a backwards-incompatible manner. Whether this constitutes observable behavior depends on the viewpoint and expectations of the observer: an API client developer might notice and be directly affected by the change, but not the end user of the software. It has been shown that behavior-changing modifications still qualify as refactorings [11].
- 10.
- 11.
At https://interface-refactoring.github.io we have started to publish these refactorings; names and content of the refactoring are subject to change.
- 12.
Only include a pattern if there are at least three known uses. Not to be confused with the “rule of three” of refactoring [6] duplicated pieces of code, where it refers to the number of duplicates starting from which a refactoring is recommended.
- 13.
References
Balalaie, A., Heydarnoori, A., Jamshidi, P.: Microservices architecture enables DevOps: migration to a cloud-native architecture. IEEE Softw. 33(3), 42–52 (2016)
Beck, K., Andres, C.: Extreme Programming Explained: Embrace Change, 2nd edn. Addison-Wesley Professional, Boston (2004)
Cossette, B.E., Walker, R.J.: Seeking the ground truth: a retroactive study on the evolution and migration of software libraries. In: Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering. FSE 2012. Association for Computing Machinery, New York (2012)
Dig, D., Johnson, R.: The role of refactorings in API evolution. In: 21st IEEE International Conference on Software Maintenance (ICSM 2005), pp. 389–398 (2005)
Dig, D., Johnson, R.: How do APIs evolve? A story of refactoring: research articles. J. Softw. Maint. Evol. 18(2), 83–107 (2006)
Fowler, M.: Refactoring. Addison-Wesley Signature Series (Fowler). Addison-Wesley, Boston. 2 edn. (2018)
Hunt, A., Thomas, D.: The Pragmatic Programmer: From Journeyman to Master. Addison-Wesley, Boston (2000)
Jamshidi, P., Pahl, C., Mendonca, N.C., Lewis, J., Tilkov, S.: Microservices: the journey so far and challenges ahead. IEEE Softw. 35(03), 24–35 (2018)
Kasunic, M.: Designing an Effective Survey. Software Engineering Institute (2005)
Kerievsky, J.: Refactoring to Patterns. Pearson Higher Education (2004)
Kim, M., Zimmermann, T., Nagappan, N.: A field study of refactoring challenges and benefits. In: Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering. FSE 2012, Association for Computing Machinery, New York (2012)
Kula, R.G., Ouni, A., German, D.M., Inoue, K.: An empirical study on the impact of refactoring activities on evolving client-used APIs. Inf. Softw. Technol. 93, 186–199 (2018)
Kwon, Y.W., Tilevich, E.: Cloud refactoring: automated transitioning to cloud-based services. Autom. Softw. Eng. 21(3), 345–372 (2014)
Li, J., Xiong, Y., Liu, X., Zhang, L.: How does web service API evolution affect clients? In: 2013 IEEE 20th International Conference on Web Services, pp. 300–307 (2013)
Lübke, D., Zimmermann, O., Stocker, M., Pautasso, C., Zdun, U.: Interface evolution patterns - balancing compatibility and extensibility across service life cycles. In: Proceedings of the 24th EuroPLoP conference. EuroPLoP 2019 (2019)
Menascé, D.A.: QoS issues in web services. IEEE Internet Comput. 6(6), 72–75 (2002)
Neri, D., Soldani, J., Zimmermann, O., Brogi, A.: Design principles, architectural smells and refactorings for microservices: a multivocal review. SICS Softw. Intensive Cyber Phys. Syst. 35(1), 3–15 (2020)
Pautasso, C., Zimmermann, O., Amundsen, M., Lewis, J., Josuttis, N.M.: Microservices in practice, part 2: service integration and sustainability. IEEE Softw. 34(2), 97–104 (2017)
Rodríguez, C., et al.: REST APIs: a large-scale analysis of compliance with principles and best practices. In: Bozzon, A., Cudre-Maroux, P., Pautasso, C. (eds.) ICWE 2016. LNCS, vol. 9671, pp. 21–39. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-38791-8_2
Rosenberg, F., Celikovic, P., Michlmayr, A., Leitner, P., Dustdar, S.: An end-to-end approach for QoS-aware service composition. In: IEEE International Conference on Enterprise Distributed Object Computing Conference (EDOC 2009), pp. 151–160. IEEE (2009)
Stal, M.: Agile Software Architecture. Morgan Kaufmann (12 2013)
Stocker, M., Zimmermann, O., Lübke, D., Zdun, U., Pautasso, C.: Interface quality patterns - communicating and improving the quality of microservices APIs. In: Proceedings of the 23nd EuroPLoP conference. EuroPLoP 2018 (2018)
Suryanarayana, G., Sharma, T., Samarthyam, G.: Software process versus design quality: tug of war? IEEE Softw. 32(4), 7–11 (2015)
Wang, S., Keivanloo, I., Zou, Y.: How do developers react to RESTful API evolution? In: Franch, X., Ghose, A.K., Lewis, G.A., Bhiri, S. (eds.) ICSOC 2014. LNCS, vol. 8831, pp. 245–259. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-45391-9_17
Zdun, U., Stocker, M., Zimmermann, O., Pautasso, C., Lübke, D.: Guiding architectural decision making on quality aspects in microservice APIs. In: 16th International Conference on Service-Oriented Computing ICSOC 2018, pp. 78–89, November 2018
Zeng, L., Benatallah, B., Dumas, M., Kalagnanam, J., Sheng, Q.Z.: Quality driven web services composition. In: Proceedings of the 12th International Conference on World Wide Web, pp. 411–421. ACM (2003)
Zimmermann, O.: Architectural refactoring: a task-centric view on software evolution. IEEE Softw. 32(2), 26–29 (2015)
Zimmermann, O.: Architectural refactoring for the cloud: decision-centric view on cloud migration. Computing 99(2), 129–145 (2017)
Zimmermann, O.: Microservices tenets. Comput. Sci. 32(3–4), 301–310 (2017)
Zimmermann, O., Lübke, D., Zdun, U., Pautasso, C., Stocker, M.: Interface responsibility patterns: processing resources and operation responsibilities. In: Proceedings of the 25th EuroPLoP conference. EuroPLoP 2020 (2020)
Zimmermann, O., Pautasso, Cesare Lübke, D., Zdun, U., Stocker, M.: Data-oriented interface responsibility patterns: types of information holder resources. In: Proceedings of the 25th EuroPLoP conference. EuroPLoP 2020 (2020)
Zimmermann, O., Stocker, M., Lübke, D., Pautasso, C., Zdun, U.: Introduction to microservice API patterns (MAP). In: Cruz-Filipe, L., Giallorenzo, S., Montesi, F., Peressotti, M., Rademacher, F., Sachweh, S. (eds.) Joint Post-proceedings of the First and Second International Conference on Microservices (Microservices 2017/2019), vol. 78, pp. 4:1–4:17 (2020)
Zimmermann, O., Stocker, M., Lübke, D., Zdun, U.: Interface representation patterns: crafting and consuming message-based remote APIs. In: Proceedings of the 22nd EuroPLop, EuroPLoP 2017, pp. 27:1–27:36. ACM (2017)
Acknowledgments
We would like to thank all reviewers and participants of the survey. The work of Mirko Stocker and Olaf Zimmermann is supported by the Hasler Foundation through grant nr. 21004.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Stocker, M., Zimmermann, O. (2021). From Code Refactoring to API Refactoring: Agile Service Design and Evolution. In: Barzen, J. (eds) Service-Oriented Computing. SummerSOC 2021. Communications in Computer and Information Science, vol 1429. Springer, Cham. https://doi.org/10.1007/978-3-030-87568-8_11
Download citation
DOI: https://doi.org/10.1007/978-3-030-87568-8_11
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-87567-1
Online ISBN: 978-3-030-87568-8
eBook Packages: Computer ScienceComputer Science (R0)