Program clones detection as natural language texts fragments based on constructive-synthesizing modeling

The developed and tested method for comparing the structure of natural language texts is adapted to the analysis of program texts.The method is based on the use of stochastic grammars, including rules that describe the algorithmic structure of programs.The certain structures appearance probability is calculated as the product of the different program elements probabilities.Constructive-production modeling tools were used to form the rules.An experiment was conducted to verify the possibility of using this method to detect clones in the programs source text in C++ and C#.Different types of tasks and their software implementations were studied: both those that are equivalent in control flow but different in calculations, and vice versa.As a result of the experiments, it was found that programs that solve different tasks but have almost identical algorithms have high values of similarity indicators.If the algorithms are similar, but solve different tasks, the indicators are slightly lower.Similarity indicators from low to medium, obtained in cases where different tasks are solved with different algorithms that is due to the use of a single programming language syntax.

Publication Details

Published
2025-05-16
DOI
https://doi.org/10.31110/colins/2025-1/002
Primary Topic
Mycotoxins in Agriculture and Food
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Program clones detection as natural language texts fragments based on constructive-synthesizing modeling

Mycotoxins in Agriculture and Food
article

Program clones detection as natural language texts fragments based on constructive-synthesizing modeling

article en

Abstract

The developed and tested method for comparing the structure of natural language texts is adapted to the analysis of program texts.The method is based on the use of stochastic grammars, including rules that describe the algorithmic structure of programs.The certain structures appearance probability is calculated as the product of the different program elements probabilities.Constructive-production modeling tools were used to form the rules.An experiment was conducted to verify the possibility of using this method to detect clones in the programs source text in C++ and C#.Different types of tasks and their software implementations were studied: both those that are equivalent in control flow but different in calculations, and vice versa.As a result of the experiments, it was found that programs that solve different tasks but have almost identical algorithms have high values of similarity indicators.If the algorithms are similar, but solve different tasks, the indicators are slightly lower.Similarity indicators from low to medium, obtained in cases where different tasks are solved with different algorithms that is due to the use of a single programming language syntax.

Quality Education
Openalex Percentile: Top 33%
Mycotoxins in Agriculture and Food
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.