ZC3: Zero-Shot Cross-Language Code Clone Detection

08/26/2023
by   Jia Li, et al.
0

Developers introduce code clones to improve programming productivity. Many existing studies have achieved impressive performance in monolingual code clone detection. However, during software development, more and more developers write semantically equivalent programs with different languages to support different platforms and help developers translate projects from one language to another. Considering that collecting cross-language parallel data, especially for low-resource languages, is expensive and time-consuming, how designing an effective cross-language model that does not rely on any parallel data is a significant problem. In this paper, we propose a novel method named ZC3 for Zero-shot Cross-language Code Clone detection. ZC3 designs the contrastive snippet prediction to form an isomorphic representation space among different programming languages. Based on this, ZC3 exploits domain-aware learning and cycle consistency learning to further constrain the model to generate representations that are aligned among different languages meanwhile are diacritical for different types of clones. To evaluate our approach, we conduct extensive experiments on four representative cross-language clone detection datasets. Experimental results show that ZC3 outperforms the state-of-the-art baselines by 67.12 We further investigate the representational distribution of different languages and discuss the effectiveness of our method.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/02/2022

Transfer Language Selection for Zero-Shot Cross-Lingual Abusive Language Detection

We study the selection of transfer languages for automatic abusive langu...
research
02/23/2022

Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt

Prompt-based tuning has been proven effective for pretrained language mo...
research
05/01/2022

Unified Abstract Syntax Tree Representation Learning for Cross-Language Program Classification

Program classification can be regarded as a high-level abstraction of co...
research
05/09/2023

Boosting Zero-shot Cross-lingual Retrieval by Training on Artificially Code-Switched Data

Transferring information retrieval (IR) models from a high-resource lang...
research
12/19/2022

MultiCoder: Multi-Programming-Lingual Pre-Training for Low-Resource Code Completion

Code completion is a valuable topic in both academia and industry. Recen...
research
06/10/2019

SAR: Learning Cross-Language API Mappings with Little Knowledge

To save manual effort, developers often translate programs from one prog...
research
04/03/2022

MSCCD: Grammar Pluggable Clone Detection Based on ANTLR Parser Generation

For various reasons, programming languages continue to multiply and evol...

Please sign up or login with your details

Forgot password? Click here to reset