<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">mais</journal-id><journal-title-group><journal-title xml:lang="ru">Моделирование и анализ информационных систем</journal-title><trans-title-group xml:lang="en"><trans-title>Modeling and Analysis of Information Systems</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1818-1015</issn><issn pub-type="epub">2313-5417</issn><publisher><publisher-name>Yaroslavl State University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.18255/1818-1015-2017-6-677-690</article-id><article-id custom-type="elpub" pub-id-type="custom">mais-606</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Оригинальные статьи</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>Articles</subject></subj-group></article-categories><title-group><article-title>Семантически-ориентированная миграция Java-программ: опыт практического применения</article-title><trans-title-group xml:lang="en"><trans-title>Semantics-Driven Migration of Java Programs: a Practical Experience</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0001-5087-5567</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Алексюк</surname><given-names>Артем Олегович</given-names></name><name name-style="western" xml:lang="en"><surname>Aleksyuk</surname><given-names>Artyom O.</given-names></name></name-alternatives><bio xml:lang="ru"><p>студент</p></bio><bio xml:lang="en"><p>student</p></bio><email xlink:type="simple">aleksyuk@kspt.icc.spbstu.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0003-0276-4517</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Ицыксон</surname><given-names>Владимир Михайлович</given-names></name><name name-style="western" xml:lang="en"><surname>Itsykson</surname><given-names>Vladimir M.</given-names></name></name-alternatives><bio xml:lang="ru"><p>канд. техн. наук, доцент</p></bio><bio xml:lang="en"><p>PhD</p></bio><email xlink:type="simple">vlad@icc.spbstu.ru</email><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Санкт-Петербургский политехнический университет Петра Великого</institution><country>Россия</country></aff><aff xml:lang="en"><institution>Peter the Great St. Petersburg Polytechnic University</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2017</year></pub-date><pub-date pub-type="epub"><day>18</day><month>12</month><year>2017</year></pub-date><volume>24</volume><issue>6</issue><fpage>677</fpage><lpage>690</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Алексюк А.О., Ицыксон В.М., 2017</copyright-statement><copyright-year>2017</copyright-year><copyright-holder xml:lang="ru">Алексюк А.О., Ицыксон В.М.</copyright-holder><copyright-holder xml:lang="en">Aleksyuk A.O., Itsykson V.M.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://www.mais-journal.ru/jour/article/view/606">https://www.mais-journal.ru/jour/article/view/606</self-uri><abstract><p>Данная статья посвящена разработке процедуры автоматизированной миграции Java-программ на новый набор библиотек. Задача миграции (портирования) кода часто встречается в современных программных проектах. Например, такая задача может возникнуть, когда проект необходимо перенести на более безопасную или функциональную библиотеку, на новую платформу или на новую версию уже используемой в проекте библиотеки. В данной работе представлена процедура автоматизированной миграции, основанная на семантическом подходе. Для процедуры миграции была разработана метамодель библиотеки, использующая предложенный ранее авторами формализм и предназначенная для описания библиотек на объектно-ориентированных языках. Формализм описывает поведение библиотек с помощью системы расширенных конечных автоматов (РКА). Процедура миграции разбита на пять шагов, каждый шаг подробно описан в тексте статьи. В процедуре используется алгоритм вычисления эквивалентной трассы на основе поиска в ширину, расширенный для решения задач миграции. Предложенная процедура реализована в прототипе инструмента миграции. Инструмент включает в себя модули извлечения трассы выполнения программ, визуализации моделей библиотек, взаимодействия с пользователем и непосредственно миграции. Для инструмента был разработан язык описания библиотек. Прототип инструмента был протестирован как на искусственных примерах, так и на существующем проекте. В статье подробно описаны проведенные эксперименты, отдельно отмечены сложности, возникающие в процессе миграции тестовых примеров, и то, как они решаются в предложенной процедуре. В качестве библиотек в экспериментах используются реализации протокола HTTP и библиотеки протоколирования. Результаты тестирования показали, что миграция кода может быть успешно автоматизирована с использованием разработанной процедуры.</p><p> </p></abstract><trans-abstract xml:lang="en"><p>The purpose of the study is to demonstrate the feasibility of automated code migration to a new set of programming libraries. Code migration is a common task in modern software projects. For example, it may arise when a project should be ported to a more secure or feature-rich library, a new platform or a new version of an already used library. The developed method and tool are based on the previously created by the authors a formalism for describing libraries semantics. The formalism specifies a library behaviour by using a system of extended finite state machines (EFSM). This paper outlines the metamodel designed to specify library descriptions and proposes an easy to use domainspecific language (DSL), which can be used to define models for particular libraries. The mentioned metamodel directly forms the code migration procedure. A process of migration is split into five steps, and each step is also described in the paper. The procedure uses an algorithm based on the breadth- first search extended for the needs of the migration task. Models and algorithms were implemented in the prototype of an automated code migration tool. The prototype was tested by both artificial code examples 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 results of experiments indicate that code migration can be successfully automated.</p><p> </p></trans-abstract><kwd-group xml:lang="ru"><kwd>программная библиотека</kwd><kwd>миграция программ</kwd><kwd>поведенческое описание</kwd><kwd>трансформация программ</kwd></kwd-group><kwd-group xml:lang="en"><kwd>software library</kwd><kwd>code migration</kwd><kwd>behavioral description</kwd><kwd>program transformation</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">Ицыксон В. М., “Формализм и языковые инструменты для описания семантики программных библиотек”, Моделирование и анализ информационных систем, 23:6 (2016), 754–766</mixed-citation><mixed-citation xml:lang="en">Itsykson V. M., “The Formalism and Language Tools for Semantics Specification of Software Libraries”, Modeling and Analysis of Information Systems, 23:6 (2016), 754– 766, (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Baxter I.D., Pidgeon C., Mehlich M., “DMS/spl reg: program transformations for practical scalable software evolution”, Proceedings of 26th International Conference on Software Engineering, IEEE, 2004, 625–634.</mixed-citation><mixed-citation xml:lang="en">Baxter I.D., Pidgeon C., Mehlich M., “DMS/spl reg: program transformations for practical scalable software evolution”, Proceedings of 26th International Conference on Software Engineering, IEEE, 2004, 625–634.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Bravenboer M. et al., “Stratego/XT 0.17. A language and toolset for program transformation”, Science of computer programming, 72:1 (2008), 52–70.</mixed-citation><mixed-citation xml:lang="en">Bravenboer M. et al., “Stratego/XT 0.17. A language and toolset for program transformation”, Science of computer programming, 72:1 (2008), 52–70.</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Broeksema B., Telea A., “Visual support for porting large code bases”, Visualizing Software for Understanding and Analysis (VISSOFT), 2011 6th IEEE International Workshop on, IEEE, 2011, 1–8.</mixed-citation><mixed-citation xml:lang="en">Broeksema B., Telea A., “Visual support for porting large code bases”, Visualizing Software for Understanding and Analysis (VISSOFT), 2011 6th IEEE International Workshop on, IEEE, 2011, 1–8.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Christoph A., M¨uller M.M., “GREAT: UML transformation tool for porting middleware applications”, International Conference on the Unified Modeling Language, Springer, 2003, 18–30.</mixed-citation><mixed-citation xml:lang="en">Christoph A., M¨uller M.M., “GREAT: UML transformation tool for porting middleware applications”, International Conference on the Unified Modeling Language, Springer, 2003, 18–30.</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Cordy J.R., “The TXL source transformation language”, Science of Computer Programming, 61:3 (2006), 190–210.</mixed-citation><mixed-citation xml:lang="en">Cordy J.R., “The TXL source transformation language”, Science of Computer Programming, 61:3 (2006), 190–210.</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">Eisenbarth T., Koschke R., Vogel G., “Static trace extraction”, Reverse Engineering, 2002. Proceedings. Ninth Working Conference on, IEEE, 2002, 128–137.</mixed-citation><mixed-citation xml:lang="en">Eisenbarth T., Koschke R., Vogel G., “Static trace extraction”, Reverse Engineering, 2002. Proceedings. Ninth Working Conference on, IEEE, 2002, 128–137.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Filman R.E., Havelund K., “Source-code instrumentation and quantification of events”, Workshop on Foundations of Aspect-Oriented Languages (FOAL) at AOSD Conference, Twente, Netherlands, 2002, 45–49.</mixed-citation><mixed-citation xml:lang="en">Filman R.E., Havelund K., “Source-code instrumentation and quantification of events”, Workshop on Foundations of Aspect-Oriented Languages (FOAL) at AOSD Conference, Twente, Netherlands, 2002, 45–49.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">Jemerov D., “Implementing refactorings in IntelliJ IDEA”, Proceedings of the 2nd Workshop on Refactoring Tools, ACM, 2008, 13.</mixed-citation><mixed-citation xml:lang="en">Jemerov D., “Implementing refactorings in IntelliJ IDEA”, Proceedings of the 2nd Workshop on Refactoring Tools, ACM, 2008, 13.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Marosi A.C., Balaton Z., Kacsuk P., “GenWrapper: A generic wrapper for running legacy applications on desktop grids”, 2009 IEEE International Symposium on Parallel Distributed Processing, ACM, 2009, 1–6.</mixed-citation><mixed-citation xml:lang="en">Marosi A.C., Balaton Z., Kacsuk P., “GenWrapper: A generic wrapper for running legacy applications on desktop grids”, 2009 IEEE International Symposium on Parallel Distributed Processing, ACM, 2009, 1–6.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">Wu L. et al., “Transforming Code with Compositional Mappings for API-Library Switching”, 2015 IEEE 39th Annual Computer Software and Applications Conference, 2, 2015, 316–325.</mixed-citation><mixed-citation xml:lang="en">Wu L. et al., “Transforming Code with Compositional Mappings for API-Library Switching”, 2015 IEEE 39th Annual Computer Software and Applications Conference, 2, 2015, 316–325.</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">“A conformant OpenGL ES implementation for Windows, Mac and Linux”, https:// github.com/google/angle, visited on 03.09.2017.</mixed-citation><mixed-citation xml:lang="en">“A conformant OpenGL ES implementation for Windows, Mac and Linux”, https:// github.com/google/angle, visited on 03.09.2017.</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">“Simple Logging Facade for Java (SLF4J)”, https://www.slf4j.org/, visited on 03.09.2017.</mixed-citation><mixed-citation xml:lang="en">“Simple Logging Facade for Java (SLF4J)”, https://www.slf4j.org/, visited on 03.09.2017.</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">JetBrains, “Statically typed programming language for the JVM, Android and the browser”, https://kotlinlang.org/, visited on 03.09.2017.</mixed-citation><mixed-citation xml:lang="en">JetBrains, “Statically typed programming language for the JVM, Android and the browser”, https://kotlinlang.org/, visited on 03.09.2017.</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
