Abstract
Refactorings are important for object-oriented (OO) programs. Actor- and active object programs place an emphasis on concurrency. In this article, we show how well-known OO refactorings such as Hide Delegate, Move Method, and Extract Class interact with a concurrency model that distinguishes between local and remote objects. Refactorings that are straightforward in Java suddenly force the developers to reflect on the underlying assumptions of their actor system. We show that this reflection is primarily necessary for refactorings that add or remove method calls, as well as constructor invocations. We present a general notion of correctness of refactorings in a concurrent setting, and indicate which refactorings are correct under this notion. Finally, we discuss how development tools can assist the developer with refactorings in languages with rich semantics.
Partially supported by DIKU/CAPES project “Modern Refactoring” and CNPq.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
We refer to the semantics in [11], although the ABS surface language has evolved and among other small changes now uses and instead of / .
- 2.
References
Swanson, E.B.: The dimensions of maintenance. In: Proceedings of the International Conference on Software Engineering, ICSE. IEEE (1976)
Opdyke, W.: Refactoring object-oriented frameworks. Ph.D. thesis, University of Illinois at Urbana-Champaign (1992)
Fowler, M.: Refactoring - Improving the Design of Existing Code. Addison Wesley Object Technology Series. Addison-Wesley, Boston (1999)
Beck, K.: Extreme Programming Explained: Embrace Change. Addison-Wesley Longman Publishing Company, Inc. (2000)
Schäfer, M., de Moor, O.: Specifying and implementing refactorings. In: Object-Oriented Programming, Systems, Languages, and Applications (2010)
Daniel, B., Dig, D., Garcia, K., Marinov, D.: Automated testing of refactoring engines. In: Proceedings of the Foundations of Software Engineering. ACM (2007)
Soares, G., Gheyi, R., Massoni, T.: Automated behavioral testing of refactoring engines. IEEE Trans. Softw. Eng. 39(2), 147–162 (2013)
Eilertsen, A.M., Bagge, A.H., Stolz, V.: Safer refactorings. In: Margaria, T., Steffen, B. (eds.) ISoLA 2016. LNCS, vol. 9952, pp. 517–531. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-47166-2_36
Gheyi, R., Massoni, T., Borba, P.: An abstract equivalence notion for object models. Electron. Notes Theor. Comput. Sci. 130, 3–21 (2005)
Boer, F.D., et al.: A survey of active object languages. ACM Comput. Surv. 50(5), 76:1–76:39 (2017)
Johnsen, E.B., Hähnle, R., Schäfer, J., Schlatte, R., Steffen, M.: ABS: a core language for abstract behavioral specification. In: Aichernig, B.K., de Boer, F.S., Bonsangue, M.M. (eds.) FMCO 2010. LNCS, vol. 6957, pp. 142–164. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-25271-6_8
Welsch, Y., Schäfer, J., Poetzsch-Heffter, A.: Location types for safe programming with near and far references. In: Clarke, D., Noble, J., Wrigstad, T. (eds.) Aliasing in Object-Oriented Programming. Types, Analysis and Verification. LNCS, vol. 7850, pp. 471–500. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-36946-9_16
Giachino, E., Laneve, C., Lienhardt, M.: A framework for deadlock detection in core ABS. Softw. Syst. Model. 15(4), 1013–1048 (2016)
Flores-Montoya, A.E., Albert, E., Genaim, S.: May-happen-in-parallel based deadlock analysis for concurrent objects. In: Beyer, D., Boreale, M. (eds.) FMOODS/FORTE -2013. LNCS, vol. 7892, pp. 273–288. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38592-6_19
Hewitt, C., Bishop, P., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In: Proceedings of the International Joint Conference on Artificial Intelligence. Morgan Kaufmann Publishers Inc. (1973)
Johnsen, E.B., Owe, O.: An asynchronous communication model for distributed concurrent objects. In: Software Engineering and Formal Methods. IEEE Computer Society (2004)
Schäfer, M., Dolby, J., Sridharan, M., Torlak, E., Tip, F.: Correct refactoring of concurrent Java code. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 225–249. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14107-2_11
Agha, G., Palmskog, K.: Transforming threads into actors: learning concurrency structure from execution traces. In: Lohstroh, M., Derler, P., Sirjani, M. (eds.) Principles of Modeling. LNCS, vol. 10760, pp. 16–37. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-95246-8_2
Ringdal, P.O.: Automated refactorings of Rust programs. Master’s thesis, Institute for Informatics, University of Oslo, Norway, June 2020
Garrido, A., Meseguer, J.: Formal specification and verification of Java refactorings. In: International Workshop on Source Code Analysis and Manipulation. IEEE (2006)
Schäfer, M., Verbaere, M., Ekman, T., de Moor, O.: Stepping stones over the refactoring Rubicon. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 369–393. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03013-0_17
Steinhöfel, D., Hähnle, R.: Abstract execution. In: ter Beek, M.H., McIver, A., Oliveira, J.N. (eds.) FM 2019. LNCS, vol. 11800, pp. 319–336. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-30942-8_20
Steinhöfel, D.: Abstract execution: automatically proving infinitely many programs. Ph.D. thesis, TU Darmstadt, Department of Computer Science, May 2020
Mongiovi, M., Mendes, G., Gheyi, R., Soares, G., Ribeiro, M.: Scaling testing of refactoring engines. In: Software Maintenance and Evolution. ICSME (2014)
Soares, G., Gheyi, R., Serey, D., Massoni, T.: Making program refactoring safer. IEEE Softw. 27(4), 52–57 (2010)
Pradel, M., Gross, T.R.: Automatic testing of sequential and concurrent substitutability. In: International Conference on Software Engineering, ICSE. IEEE (2013)
Li, S., Hariri, F., Agha, G.: Targeted test generation for actor systems. In: Proceedings European Conference on Object-Oriented Programming, LIPIcs, vol. 109. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2018)
Rachatasumrit, N., Kim, M.: An empirical investigation into the impact of refactoring on regression testing. In: International Conference on Software Maintenance. ICSM (2012)
Mongiovi, M., Gheyi, R., Soares, G., Teixeira, L., Borba, P.: Making refactoring safer through impact analysis. Sci. Comput. Program. 93, 39–64 (2014)
Alves, E.L.G., Massoni, T., de Lima Machado, P.D.: Test coverage of impacted code elements for detecting refactoring faults: an exploratory study. J. Syst. Softw. 123, 223–238 (2017)
Schulze, S., Richers, O., Schaefer, I.: Refactoring delta-oriented software product lines. In: Aspect-Oriented Software Development. ACM (2013)
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Stolz, V., Pun, V.K.I., Gheyi, R. (2020). Refactoring and Active Object Languages. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation: Engineering Principles. ISoLA 2020. Lecture Notes in Computer Science(), vol 12477. Springer, Cham. https://doi.org/10.1007/978-3-030-61470-6_9
Download citation
DOI: https://doi.org/10.1007/978-3-030-61470-6_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-61469-0
Online ISBN: 978-3-030-61470-6
eBook Packages: Computer ScienceComputer Science (R0)