A method for calculating the similarity measure of program code fragments

View at publisher
Authors: V.I. Zorin, E.K. Lipachev
Cited by: 1

Abstract

Problem Statement. An effective system for cross-language search for semantically similar fragments of software code is needed, as existing solutions typically support a limited number of programming languages and weakly consider both the syntactic and semantic content of source code. Objective. To develop a method for calculating the similarity measure of source code fragments based on identifying syntactic and semantic characteristics of the code and ensuring comparability across different programming languages. Results. A method for calculating the similarity measure of program code fragments is proposed. The method is based on fragment vectorization using machine learning models. The high efficiency of the UniXcoder and CodeBERT models for identifying semantic cross-language clones has been experimentally confirmed. An algorithm for identifying the programming language based on reserved words is developed and validated. Practical Relevance. The software tool for searching for similar code fragments, implemented using the method presented in this paper, can be used for cross-language search in the program code space. Integration of the software tool into the OntoMath digital ecosystem of the Lobachevskii Digital Mathematical Library is planned.

Fields of Study & Subjects

Software Engineering Research Statistical and Computational Modeling Software Testing and Debugging Techniques

Publication details

Journal / source
Highly available systems
Publisher
Publishing house "Radiotekhnika"
Pages
47–50
Publication date
1 January 2026