Comparison of Similarity Functions for n-gram Software Birthmarks

Various software birthmarks have been proposed to detect software plagiarism or unauthorized reuse of code. If two software products have very similar birthmarks, the existence of reused code between them is strongly suspected. However, the accuracy of detecting reused code depends on the similarity function for comparing birthmarks and the threshold for distinguishing reused and non-reused codes. Moreover, since software products usually consist of many program modules such as source files and class files, an appropriate method to compare the set of modules between two software products is needed. In this paper we propose a method for comparing birthmarks between two software products containing many modules, as well as a method for determining the threshold for distinguishing reuse. Afterwards, focusing on the n-gram birthmarks, which is one of the most easy-to-measure birthmarks, we empirically compare 4 similarity functions: cosine similarity, Dice index, Jaccard coefficient and Simpson index. In the experiment, we employ multiple versions of 15 open-source software (OSS) projects of 5 categories, making sure that they contain project pairs that contain reused code and that do not contain reused code. The experimental result shows that, for both 3-gram and 6-gram birthmarks, Jaccard coefficient showed the best performance in terms of F1-score to identify reused code.

Authors

Institutions

Publication Details

Published
2024-09-13
DOI
https://doi.org/10.1145/3698062.3698087
Citations
1
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.78
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Comparison of Similarity Functions for n-gram Software Birthmarks

Nikolay Fedorov, Haruaki Tamada, Hiroki Inayoshi, Akito Monden
1 citations
Software Engineering Research
0.78
article

Comparison of Similarity Functions for n-gram Software Birthmarks

Nikolay Fedorov, Haruaki Tamada, Hiroki Inayoshi, Akito Monden
article en
1 citations

Abstract

Various software birthmarks have been proposed to detect software plagiarism or unauthorized reuse of code. If two software products have very similar birthmarks, the existence of reused code between them is strongly suspected. However, the accuracy of detecting reused code depends on the similarity function for comparing birthmarks and the threshold for distinguishing reused and non-reused codes. Moreover, since software products usually consist of many program modules such as source files and class files, an appropriate method to compare the set of modules between two software products is needed. In this paper we propose a method for comparing birthmarks between two software products containing many modules, as well as a method for determining the threshold for distinguishing reuse. Afterwards, focusing on the n-gram birthmarks, which is one of the most easy-to-measure birthmarks, we empirically compare 4 similarity functions: cosine similarity, Dice index, Jaccard coefficient and Simpson index. In the experiment, we employ multiple versions of 15 open-source software (OSS) projects of 5 categories, making sure that they contain project pairs that contain reused code and that do not contain reused code. The experimental result shows that, for both 3-gram and 6-gram birthmarks, Jaccard coefficient showed the best performance in terms of F1-score to identify reused code.

Okayama University (JP), Kyoto Sangyo University (JP)
Openalex Percentile: Top 19%
Software Engineering Research
0.78
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.