Login | Register

An Improved Approach for Extracting Frequently Extracted Code Idioms

Title:

An Improved Approach for Extracting Frequently Extracted Code Idioms

Borhan Uddin, Md (2023) An Improved Approach for Extracting Frequently Extracted Code Idioms. Masters thesis, Concordia University.

[thumbnail of BorhanUddin_MASc_F2023.pdf]
Preview
Text (application/pdf)
BorhanUddin_MASc_F2023.pdf - Accepted Version
Available under License Spectrum Terms of Access.
1MB

Abstract

Source code refactoring is a process of restructuring or changing the existing codes without changing their external behaviour. This is a continuous process done by the developers to improve code quality, readability, maintainability of the source code, and address technical debt. There have been studies and tools to aid developers to refactor effectively their source code and to understand the motivations behind refactorings applied by developers. We aim to find Code Idioms that developers tend to refactor more frequently and investigate whether there are unique refactored code idioms for production code and test code. We use the RefactoringMiner tool to detect and collect EXTRACT METHOD refactoring from the commit history of the projects and propose a technique to represent the code fragments as structure-preserving context-free independent graphs and apply graph-similarity measure techniques to find similar code idioms among 65,742 EXTRACT METHOD instances. We measure both exact matching and partial matching with constraint checking from the associated metadata of the nodes and edges of the graphs. We divide our data set into production code and test code and found a total of 489 code idiom patterns. We present in detail 22 of the most frequently refactored code idioms. There are unique patterns to production code and test code and patterns shared among them. We limit our study to only Java-based open-source projects and EXTRACT METHOD refactoring, but we believe the approach can be applied to other object-oriented languages or refactorings. The findings can be useful to design an effective refactoring recommender system, help developers gain confidence in refactoring recommendation tools, and help researchers understand refactoring motivations and API usage patterns.

Divisions:Concordia University > Gina Cody School of Engineering and Computer Science > Computer Science and Software Engineering
Item Type:Thesis (Masters)
Authors:Borhan Uddin, Md
Institution:Concordia University
Degree Name:M.A. Sc.
Program:Software Engineering
Date:7 June 2023
Thesis Supervisor(s):Tsantalis, Nikolaos
ID Code:992329
Deposited By: Md Borhan Uddin
Deposited On:17 Nov 2023 14:57
Last Modified:17 Nov 2023 14:57
All items in Spectrum are protected by copyright, with all rights reserved. The use of items is governed by Spectrum's terms of access.

Repository Staff Only: item control page

Downloads per month over past year

Research related to the current document (at the CORE website)
- Research related to the current document (at the CORE website)
Back to top Back to top