Skip to main content

Refactoring and Active Object Languages

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12477))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.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

Learn about institutional subscriptions

Notes

  1. 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. 2.

    https://microsoft.github.io/language-server-protocol/.

References

  1. Swanson, E.B.: The dimensions of maintenance. In: Proceedings of the International Conference on Software Engineering, ICSE. IEEE (1976)

    Google Scholar 

  2. Opdyke, W.: Refactoring object-oriented frameworks. Ph.D. thesis, University of Illinois at Urbana-Champaign (1992)

    Google Scholar 

  3. Fowler, M.: Refactoring - Improving the Design of Existing Code. Addison Wesley Object Technology Series. Addison-Wesley, Boston (1999)

    MATH  Google Scholar 

  4. Beck, K.: Extreme Programming Explained: Embrace Change. Addison-Wesley Longman Publishing Company, Inc. (2000)

    Google Scholar 

  5. Schäfer, M., de Moor, O.: Specifying and implementing refactorings. In: Object-Oriented Programming, Systems, Languages, and Applications (2010)

    Google Scholar 

  6. Daniel, B., Dig, D., Garcia, K., Marinov, D.: Automated testing of refactoring engines. In: Proceedings of the Foundations of Software Engineering. ACM (2007)

    Google Scholar 

  7. Soares, G., Gheyi, R., Massoni, T.: Automated behavioral testing of refactoring engines. IEEE Trans. Softw. Eng. 39(2), 147–162 (2013)

    Article  Google Scholar 

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

    Chapter  Google Scholar 

  9. Gheyi, R., Massoni, T., Borba, P.: An abstract equivalence notion for object models. Electron. Notes Theor. Comput. Sci. 130, 3–21 (2005)

    Article  Google Scholar 

  10. Boer, F.D., et al.: A survey of active object languages. ACM Comput. Surv. 50(5), 76:1–76:39 (2017)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

  13. Giachino, E., Laneve, C., Lienhardt, M.: A framework for deadlock detection in core ABS. Softw. Syst. Model. 15(4), 1013–1048 (2016)

    Article  Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

  16. Johnsen, E.B., Owe, O.: An asynchronous communication model for distributed concurrent objects. In: Software Engineering and Formal Methods. IEEE Computer Society (2004)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

  19. Ringdal, P.O.: Automated refactorings of Rust programs. Master’s thesis, Institute for Informatics, University of Oslo, Norway, June 2020

    Google Scholar 

  20. Garrido, A., Meseguer, J.: Formal specification and verification of Java refactorings. In: International Workshop on Source Code Analysis and Manipulation. IEEE (2006)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

  23. Steinhöfel, D.: Abstract execution: automatically proving infinitely many programs. Ph.D. thesis, TU Darmstadt, Department of Computer Science, May 2020

    Google Scholar 

  24. Mongiovi, M., Mendes, G., Gheyi, R., Soares, G., Ribeiro, M.: Scaling testing of refactoring engines. In: Software Maintenance and Evolution. ICSME (2014)

    Google Scholar 

  25. Soares, G., Gheyi, R., Serey, D., Massoni, T.: Making program refactoring safer. IEEE Softw. 27(4), 52–57 (2010)

    Article  Google Scholar 

  26. Pradel, M., Gross, T.R.: Automatic testing of sequential and concurrent substitutability. In: International Conference on Software Engineering, ICSE. IEEE (2013)

    Google Scholar 

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

    Google Scholar 

  28. Rachatasumrit, N., Kim, M.: An empirical investigation into the impact of refactoring on regression testing. In: International Conference on Software Maintenance. ICSM (2012)

    Google Scholar 

  29. Mongiovi, M., Gheyi, R., Soares, G., Teixeira, L., Borba, P.: Making refactoring safer through impact analysis. Sci. Comput. Program. 93, 39–64 (2014)

    Article  Google Scholar 

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

    Google Scholar 

  31. Schulze, S., Richers, O., Schaefer, I.: Refactoring delta-oriented software product lines. In: Aspect-Oriented Software Development. ACM (2013)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Volker Stolz or Violet Ka I Pun .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics