The development of a procedure supporting automated migration of Java programs to a new set of libraries is explored. Code migration is a common task in modern software projects. For example, it may arise when a project must be ported to a more secure or feature-rich library, a new platform, or a new version of an existing library. This paper presents a procedure for semantics-driven automated migration. A metamodel that applies the formalism earlier proposed by the authors and intended to describe libraries in object-oriented languages was developed for the migration procedure. The formalism specifies a library behaviour by using a system of extended finite state machines (EFSMs). The migration is split into five steps and each step is described in the paper. The procedure applies an algorithm of an equivalent path based on a breadth-first search extended for the needs of the migration task. The proposed procedure is implemented in a prototype of the migration tool. The tool includes modules for extraction of the software execution path, visualization of library models, user interaction, and migration. A library description language was developed for the tool. The prototype was tested by both artificial code and a real-world open source project. The article describes the experiments performed, the difficulties that have arisen in the process of migration of test samples, and how they are solved in the proposed procedure. The HTTP protocol and log library are used as libraries in the experiment. The results of the experiments indicate that code migration can be successfully automated through the developed procedures.
This is a preview of subscription content, log in to check access.
Buy single article
Instant access to the full article PDF.
Price includes VAT for USA
It should be noted that the formalism is currently being refined and should not be considered final in this paper.
The original code of the tool can be accessed at https://github.com/h31/LibraryMigration.
Itsykson, V.M., Formalism and language tools for specification of the semantics of software libraries, Autom. Control Comput. Sci., 2017, vol. 51, no. 7, pp. 531–538.
Baxter, I.D., Pidgeon, C., and Mehlich, M., DMS/spl reg: Program transformations for practical scalable software evolution, Proceedings of the 26th International Conference on Software Engineering, 2004, pp. 625–634.
Bravenboer, M., et al., Stratego/XT 0.17. A language and toolset for program transformation, Sci. Comput. Program., 2008, vol. 72, no. 1, pp. 52–70.
Broeksema, B. and Telea, A., Visual support for porting large code bases, Visualizing Software for Understanding and Analysis (VISSOFT), 2011 6th IEEE International Workshop on, 2011, pp. 1–8.
Christoph, A. and Müller, M.M., GREAT: UML transformation tool for porting middleware applications, International Conference on the Unified Modeling Language, 2003, pp. 18–30.
Cordy, J.R., The TXL source transformation language, Sci. Comput. Program., 2006, vol. 61, no. 3, pp. 190–210.
Eisenbarth, T., Koschke, R., and Vogel, G., Static trace extraction, Reverse Engineering, 2002. Proceedings. Ninth Working Conference on, 2002, pp. 128–137.
Filman, R.E. and Havelund, K., Source-code instrumentation and quantification of events, Workshop on Foundations of Aspect-Oriented Languages (FOAL) at AOSD Conference, Twente, 2002, pp. 45–49.
Jemerov, D., Implementing refactorings in IntelliJ IDEA, Proceedings of the 2nd Workshop on Refactoring Tools, 2008, p. 13.
Marosi, A.C., Balaton, Z. and Kacsuk, P., GenWrapper: A generic wrapper for running legacy applications on desktop grids, 2009 IEEE International Symposium on Parallel Distributed Processing, 2009, p. 1–6.
Wu, L., et al., Transforming code with compositional mappings for API-library switching, 2015 IEEE 39th Annual Computer Software and Applications Conference, 2015, vol. 2, pp. 316–325.
A conformant OpenGL ES implementation for Windows, Mac and Linux. https://github.com/google/angle. Accessed September 3, 2017.
Simple Logging Facade for Java (SLF4J). https://www.slf4j.org/. Accessed September 3, 2017.
JetBrains, Statically typed programming language for the JVM, Android and the browser. https://kotlinlang.org/. Accessed September 3, 2017.
Translated by V. Kupriyanova-Ashina
About this article
Cite this article
Aleksyuk, A.O., Itsykson, V.M. Semantics-Driven Migration of Java Programs: A Practical Application. Aut. Control Comp. Sci. 52, 581–588 (2018). https://doi.org/10.3103/S0146411618070027
- software library
- code migration
- behavioral description
- program transformation