Program Systems: Theory and Applications
RUS  ENG    JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PACKAGE AMSBIB  
General information
Latest issue
Archive
Guidelines for authors
Submit a manuscript

Search papers
Search references

RSS
Latest issue
Current issues
Archive issues
What is RSS



Program Systems: Theory and Applications:
Year:
Volume:
Issue:
Page:
Find






Personal entry:
Login:
Password:
Save password
Enter
Forgotten password?
Register


Program Systems: Theory and Applications, 2022, Volume 13, Issue 1, Pages 3–33
DOI: https://doi.org/10.25209/2079-3316-2022-13-1-3-33
(Mi ps390)
 

Mathematical Foundations of Programming

Robust algorithmic binding to arbitrary fragment of program code

A. V. Goloveshkin, S. S. Mikhalkovich

Southern Federal University, Rostov-on-Don, Russia
References:
Abstract: When developing a program, one of the most frequent programmer's activities is navigating the code. Solving a certain task, a programmer actively interacts with a finite set of code fragments. Preserving the information about locations of these fragments is important for quick navigation, collaboration with other developers, and using this information as a kind of documentation after some time. Integrated development environments (IDEs) provide tools for marking code fragments with labels, displaying lists of labels in the interface of an IDE, and using these labels for quick navigation. However, these tools often cannot maintain an up-to-date correspondence between the label and the marked place when the code is changed, for example, when changes are made outside of an IDE.
Earlier, the authors proposed a tool that can be integrated into multiple IDEs and used for marking large syntactic entities of a program. Marking an entity is also called "binding" to an entity. The main advantage of the approach proposed is that binding is robust to code editing. The labelled element is described as a model built on the basis of the abstract syntax tree (AST) of the program. This model is then used to algorithmically search for the marked element in the edited code. The success rate of such a search is between 99 and 100%.
The main goal of the present research is to perform robust algorithmic binding to an arbitrary part of the code. To achieve this goal, the problems of binding to a single-line code fragment (1) and to a multi-line fragment (2) are solved. To solve the problem (1), an extension of the model describing the marked fragment and an additional search algorithm are proposed. To solve the problem (2), a necessary formalization is introduced, and an algorithm for embedding nodes corresponding to labelled multi-line fragments into the AST is proposed. It is also shown that the correctness of the AST is not violated with such embedding. In the experiment, we use the proposed models and algorithms for binding to randomly selected lines in the codebases of three large projects written in C# and for subsequent algorithmic search for these lines in the edited code. Search results are analyzed manually. It is confirmed that binding is robust to code editing.
Key words and phrases: program markup, algorithmic binding to program code, software development, abstract syntax tree, code similarity measurement.
Received: 28.12.2021
Accepted: 19.02.2022
English version:
Program Systems: Theory and Applications, 2022, Volume 13, Issue 1, Pages 35–62
DOI: https://doi.org/10.25209/2079-3316-2022-13-1-35-62
Bibliographic databases:
Document Type: Article
UDC: 004.4’23+004.415+004.02
BBC: 32.973.3
MSC: Primary 68U99; Secondary 68W05
Language: Russian
Citation: A. V. Goloveshkin, S. S. Mikhalkovich, “Robust algorithmic binding to arbitrary fragment of program code”, Program Systems: Theory and Applications, 13:1 (2022), 3–33; Program Systems: Theory and Applications, 13:1 (2022), 35–62
Citation in format AMSBIB
\Bibitem{GolMik22}
\by A.~V.~Goloveshkin, S.~S.~Mikhalkovich
\paper Robust algorithmic binding to arbitrary fragment of program code
\jour Program Systems: Theory and Applications
\yr 2022
\vol 13
\issue 1
\pages 3--33
\mathnet{http://mi.mathnet.ru/ps390}
\crossref{https://doi.org/10.25209/2079-3316-2022-13-1-3-33}
\mathscinet{http://mathscinet.ams.org/mathscinet-getitem?mr=4409486}
\transl
\jour Program Systems: Theory and Applications
\yr 2022
\vol 13
\issue 1
\pages 35--62
\crossref{https://doi.org/10.25209/2079-3316-2022-13-1-35-62}
Linking options:
  • https://www.mathnet.ru/eng/ps390
  • https://www.mathnet.ru/eng/ps/v13/i1/p3
  • Citing articles in Google Scholar: Russian citations, English citations
    Related articles in Google Scholar: Russian articles, English articles
    Program Systems: Theory and Applications
    Statistics & downloads:
    Abstract page:70
    Russian version PDF:49
    English version PDF:22
    References:13
     
      Contact us:
     Terms of Use  Registration to the website  Logotypes © Steklov Mathematical Institute RAS, 2024