This site requires Cookies enabled in your browser for login.
Updating ...
WaterNet Home
WaterNet
for
pour le
Canada
Menu
WaterNet
Home
GWFO
Home
Catalogue
Master Index
Data
Centre
X
Find Data By Variable Find Data By Site, Facility, or Deployable Show Near-realtime Telemetry (7 day)
Collections
X
Defaults
Select All
Websites
X
Global Water Futures Observatories (GWFO) Global Water Futures (GWF) Global Institute for Water Security (GIWS) International Network of Alpine Research Catchment Hydrology
Legacy Research Programs
X
Changing Cold Regions Network (CCRN) Drought Research Initiative (DRI) International Network of Alpine Research Catchment Hydrology (Legacy Site) Improving Processes & Parameterization for Prediction in Cold Regions Hydrology (IP3) The Mackenzie Global Energy and Water Cycle Experiment (GEWEX) Study (MAGS)
Legacy sites
Map
Utilities
X
Account Settings Create a New Record Record List Alias List Editor
Edit Data Centre
Data Types
. . .
X
Clear
Select All
Advanced Search
Go to Top⇡
Related items loading ...
Fetching Chart ...
Publication Additional Information Download
Publication Type
Thesis
Authorship
Roy, P. R.
Title
An Exploratory Study on the Roles of LLMs in Code Similarity Detection and Generation
Year
2025
Publication Outlet
University of Saskatchewan, Harvest, Graduate Theses and Dissertations
DOI
https://hdl.handle.net/10388/16429
Citation
Roy, P. R. (2025) An Exploratory Study on the Roles of LLMs in Code Similarity Detection and Generation. University of Saskatchewan, Harvest, Graduate Theses and Dissertations. https://hdl.handle.net/10388/16429
Abstract
Code similarity, also referred to as cloned code, involves identifying redundant code fragments, enabling effective refactoring, and promoting code reuse. This, in turn, enhances both the maintainability and scalability of software systems. However, despite advancements in automated tools, detecting and generating clones, particularly across different programming languages and considering semantic variations—remains a significant challenge in software engineering.

With the rise of large language models (LLMs) such as GPT, Gemini, and LLaMA, there is growing interest in leveraging their capabilities to improve clone detection, code generation, and cross-language translation. Despite this interest, research has yet to thoroughly evaluate how these models can be systematically applied to address the challenges in these domains. This thesis aims to bridge that gap by investigating the role of LLMs in three studies: clone generation, code quality assessment of similar codes, and cross-language clone detection, with the goal of advancing software engineering practices.

The first study evaluates the performance of GPT-3 in generating semantic and cross-language code clones(similar codes) using the SemanticCloneBench dataset. Extensive experiments, validated by nine expert judges over 158 hours, show that GPT-3 achieved 62.14% accuracy and a 0.55 BLEU score in semantic clone generation, along with 91.25% accuracy in cross-language clone generation. These results underscore the potential of LLMs, particularly GPT-3, to support code reuse and facilitate migration across programming languages.

The second study assesses the quality of similar code generated through three approaches: human-generated solutions from Stack Overflow, LLM-based code search tools such as CodeBERT and GraphCodeBERT, and AI-powered models including GPT-4, Gemini Pro-1.5, and LLaMA-3-8B. Analyzing 800 programming questions (400 in Python and 400 in Java), the study demonstrates that GPT-4 consistently outperformed other tools in usability, accuracy, and overall code quality, while the code search tools underperformed. These findings offer valuable insights for developers, particularly in selecting reliable tools for high-quality code generation.

In the third study, I developed Lang2Clone, a novel tool that combines zero-shot prompting with GPT for code translation and NiCad for clone detection. Evaluations on the LeetCode and GPTCloneBench datasets showed that Lang2Clone achieved recall rates of 80% and 85%, respectively, with a precision of 95%. Notably, Lang2Clone outperformed state-of-the-art tools like GraphCodeBERT and CLCDSA in cross-language clone detection, particularly when translating between languages with similar programming paradigms.

Collectively, these studies highlight the potential of LLMs to enhance key software engineering tasks, particularly in clone detection and code reuse. The findings also suggest promising avenues for future research, including the application of LLMs to broader challenges such as software maintenance and cross-language code translation, paving the way for more sophisticated and efficient development tools.
Program Affiliations
GWF: Global Water Futures
GWFO: Global Water Futures Observatories
Project Affiliations
GWF-CS: Computer Science
Publication Stage
Published
Download Links
https://hdl.handle.net/10388/16429
© 2026 - WaterNet Version 2026-08-10
Global Water Futures Observatories
Powered by
G W F Net
T-2025-11-30-61b0fjqfztEGiLvIP861sTVQ Publication 1.0