Transfer Learning Approaches for Cross-Language Code Smell Detection

Transfer Learning Approaches for Cross-Language Code Smell Detection. Masters thesis, King Fahd University of Petroleum and Minerals.

[img] PDF
[Rana Sandouka] Thesis.pdf
Restricted to Repository staff only until 24 December 2026.

Download (1MB)

Arabic Abstract

تُعد الروائح البرمجية هياكل في الشيفرة قد تشير إلى مشكلات محتملة في تصميم أو تنفيذ البرمجيات، والتي يمكن أن تؤثر سلبًا على عملية اختبار الشيفرة وصيانتها وجودة البرمجيات بشكل عام. لذلك، فإن الكشف المبكر عن هذه الروائح يُعد أمرًا بالغ الأهمية لتحسين جودة النظام. ركزت معظم الدراسات السابقة على اكتشاف الروائح البرمجية في لغة برمجة واحدة فقط. يقترح هذا البحث استخدام التعلم الانتقالي لاكتشاف الروائح البرمجية عبر لغات برمجة مختلفة، حيث تم استخدام لغة جافا كمصدر، بينما كانت سي شارب وبايثون هما مجموعتا البيانات الهدف، مع التركيز على روائح الصنف الكبير، والطريقة الطويلة، وقائمة المعاملات الطويلة. أجرينا دراسة مقارنة بين نهجين للتعلم الانتقالي: النهج المعتمد على العينات (مثل مصنف ترجيح الأهمية، وترجيح أقرب الجيران، وتعزيز آدا الانتقالي) والنهج المعتمد على المعلمات (مثل شجرة الانتقال وغابة الانتقال) باستخدام نماذج أساسية متنوعة. أظهرت النتائج أن النهج المعتمد على العينات تفوق على النهج المعتمد على المعلمات، لا سيما عند استخدام خوارزمية تعزيز آدا الانتقالي مع نماذج التعلم الجماعي. وقد حقق هذا النهج مع نموذجي التعزيز التدرجي والأشجار الإضافية نتائج قوية ومتسقة عبر كل من سي شارب وبايثون، بمعدل نجاح بلغ 83٪ وفقًا لاختبار ويلكوكسون للرتب. تؤكد هذه النتائج فعالية التعلم الانتقالي في اكتشاف الروائح البرمجية عبر لغات برمجة مختلفة، مما يدعم قابليته للتعميم.

English Abstract

Code smells are code structures that indicate a potential issue in the code design or implementation. These issues could affect the process of code testing, maintenance, and the overall software quality. Therefore, it is important to detect the code smells in the early stages of software development to enhance the system quality. Most studies have focused on detecting code smells of a single programming language. This article explores TL for cross-language code smell detection, where Java is the source and both C# and Python are the target datasets, focusing on Large Class, Long Method, and Long Parameter List code smells. We conducted a comparison study across two transfer learning approaches: instance-based (Importance Weighting Classifier, Nearest Neighbors Weighting, and Transfer AdaBoost) and parameter-based (Transfer Tree, Transfer Forest) with various base models. Results showed that instance-based outperformed the parameter-based approach particularly with Transfer AdaBoost using ensemble-learning base models. Transfer AdaBoost approach with Gradient Boosting and Extra Trees achieved consistent and robust results across both C# and Python, with an 83% winning rate as indicated by the Wilcoxon signed-rank test. These findings underscore the effectiveness of transfer learning for cross-language code smell detection, supporting its generalizability across different programming languages.

Item Type: Thesis (Masters)
Subjects: Computer
General
Research
Research > Information Technology
Department: College of Computing and Mathematics > Information and Computer Science
Committee Advisor: Aljamaan, Hamoud
Committee Members: Alshayeb, Mohammad and Ahmad, Irfan
Depositing User: RANA SANDOUKA (g202008640)
Date Deposited: 25 Dec 2025 08:20
Last Modified: 25 Dec 2025 08:20
URI: http://eprints.kfupm.edu.sa/id/eprint/143872