arrow
Return

Software system comparison with semantic source code embeddings

delete2022-03-17
delete6
PRE
AI
S
Sašo Karakatič
A
Aleksej Miloševič
T
Tjaša Heričko *
DOI:10.1007/s10664-022-10122-9delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
This paper presents a novel approach for comparing software systems by calculating the robust Hausdorff distance between semantic source code embeddings of individual software components, i.e., methods. The proposed approach represents each software as a set of vectors, where every vector is a semantic source code embedding of a particular method. The code embeddings are constructed from abstract syntax trees of the methods with the help of attention-based neural network models that capture the semantics of the methods. Previous research has shown that comparing semantic source code embeddings can reveal semantic relationships between the two methods. We utilize this characteristic to estimate the semantic similarity between the two software systems by computing the robust Hausdorff distance. In the experiment, a pre-trained code2vec neural network model is used to create the source code vector representations of several open-source Java-based libraries. Several variations of the robust Hausdorff distance are evaluated. The results show that the proposed approach can effectively estimate the semantic similarity, reflecting the software library's scopes, software evolution, and individual parts (e.g., packages) of those libraries.
Keywords:
Source code embeddings
Software comparison
Code similarity
code2vec
Machine learning

Journal

Empirical Software Engineering cover
Empirical Software Engineering
IF:
3.6
Papers:
2.0K
Citations:
5.3K

Organization

U
university of maribor
Scholars:
4.5K
Papers: 4.1K
Citations: 1