arrow
返回

Optimizing Pre-Trained Code Embeddings With Triplet Loss for Code Smell Detection

delete2025-01-01
delete0
delete
OA
AI
A
Ali Nizam *
E
Ertuğrul İslamoğlu
Ö
Ömer Kerem Adali
M
Musa Aydın
DOI:10.1109/ACCESS.2025.3542566delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code embedding represents code semantics in vector form. Although code embedding-based systems have been successfully applied to various source code analysis tasks, further research is required to enhance code embedding for better code analysis capabilities, aiming to surpass the performance and functionality of static code analysis tools. In addition, standard methods for improving code embedding are essential to develop more effective embedding-based systems, similar to augmentation techniques in the image processing domain. This study aims to create a contrastive learning-based system to explore the potential of a generic method for enhancing code embedding for code classification tasks. A triplet loss-based deep learning network is designed to optimize in-class similarity and increase the distance between classes. An experimental dataset that contains code from Java, Python, and PHP programming languages and 4 different code smells is created by collecting code from open-source repositories on GitHub. We evaluate the proposed system's effectiveness with widely used BERT, CodeBERT, and GraphCodeBERT pretrained models to create code embedding for the code classification task of code smell detection. Our findings indicate that the proposed system may offer improvements in accuracy, an average of 8% and a maximum of 13% for models. These results suggest that incorporating contrastive learning techniques into the generation process of code representation as a preprocessing step can enhance performance in code analysis.
Keyword:
Codes
Source coding
Contrastive learning
Semantics
Vectors
Transformers
Measurement
Analytical models
Syntactics
Software
Code embedding
contrastive learning
triplet loss
code smell detection

期刊

IEEE Access 封面图
IEEE Access
IF:
3.6
论文数:
9.8W
被引数:
29.4W

机构

F
Fatih Sultan Mehmet Vakif University
学者数:
185
论文数: 200
被引数: 8
引用论文

引用论文

Preweaning performance and body composition of calves from straightbred Nellore and Bos taurus × Nellore crosses1
err2009-05-01
err0
PREAI
errL. Calegare; M. M. Alencar; I. U. Packer; P. R. Leme; C. L. Ferrell; D. P. D. Lanna
err分享
err收藏
Remarkable strain-induced magnetic anisotropy in epitaxial Co2MnGa (001) films
err2005-02-01
err0
PREAI
errMichael J. Pechan; Chengtao Yu; David Carr; Chris J. Palmstrøm
err分享
err收藏
Deep Learning Based Code Smell Detection
err2021-01-01
err79
PREAI
errLiu, Hui; Jin, Jiahao; Xu, Zhifeng; Zou, Yanzhen; Bu, Yifan; Zhang, Lu
err分享
err收藏
err分享
err收藏
学者 查看更多内容