Scalable detection of missed cross-function refactorings
Refactoring is an important way to improve the design of existing code. Identifying refactoring opportunities (i.e., code fragments that can be refactored) in large code bases is a challenging task. In this paper, we propose a novel, automated and scalable technique for identifying cross-function re...
Saved in:
Main Authors: | , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2014
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/2642 https://ink.library.smu.edu.sg/context/sis_research/article/3642/viewcontent/issta14refactoring.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-3642 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-36422017-02-04T04:03:59Z Scalable detection of missed cross-function refactorings MILEA, Narcisa Andreea JIANG, Lingxiao KHOO, Siau-Cheng Refactoring is an important way to improve the design of existing code. Identifying refactoring opportunities (i.e., code fragments that can be refactored) in large code bases is a challenging task. In this paper, we propose a novel, automated and scalable technique for identifying cross-function refactoring opportunities that span more than one function (e.g., Extract Method and Inline Method). The key of our technique is the design of efficient vector inlining operations that emulate the effect of method inlining among code fragments, so that the problem of identifying cross-function refactoring can be reduced to the problem of finding similar vectors before and after inlining. We have implemented our technique in a prototype tool named ReDex which encodes Java programs to particular vectors. We have applied the tool to a large code base, 4.5 million lines of code, comprising of 200 bundle projects in the Eclipse ecosystem (e.g., Eclipse JDT, Eclipse PDE, Apache Commons, Hamcrest, etc.). Also, different from many other studies on detecting refactoring, ReDex only searches for code fragments that can be, but have not yet been, refactored in a way similar to some refactoring that happened in the code base. Our results show that ReDex can find 277 cross-function refactoring opportunities in 2 minutes, and 223 cases were labelled as true opportunities by users, and cover many categories of cross-function refactoring operations in classical refactoring books, such as Self Encapsulate Field, Decompose Conditional Expression, Hide Delegate, Preserve Whole Object, etc. 2014-07-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/2642 info:doi/10.1145/2610384.2610394 https://ink.library.smu.edu.sg/context/sis_research/article/3642/viewcontent/issta14refactoring.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Computer Sciences Software Engineering |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
Computer Sciences Software Engineering |
spellingShingle |
Computer Sciences Software Engineering MILEA, Narcisa Andreea JIANG, Lingxiao KHOO, Siau-Cheng Scalable detection of missed cross-function refactorings |
description |
Refactoring is an important way to improve the design of existing code. Identifying refactoring opportunities (i.e., code fragments that can be refactored) in large code bases is a challenging task. In this paper, we propose a novel, automated and scalable technique for identifying cross-function refactoring opportunities that span more than one function (e.g., Extract Method and Inline Method). The key of our technique is the design of efficient vector inlining operations that emulate the effect of method inlining among code fragments, so that the problem of identifying cross-function refactoring can be reduced to the problem of finding similar vectors before and after inlining. We have implemented our technique in a prototype tool named ReDex which encodes Java programs to particular vectors. We have applied the tool to a large code base, 4.5 million lines of code, comprising of 200 bundle projects in the Eclipse ecosystem (e.g., Eclipse JDT, Eclipse PDE, Apache Commons, Hamcrest, etc.). Also, different from many other studies on detecting refactoring, ReDex only searches for code fragments that can be, but have not yet been, refactored in a way similar to some refactoring that happened in the code base. Our results show that ReDex can find 277 cross-function refactoring opportunities in 2 minutes, and 223 cases were labelled as true opportunities by users, and cover many categories of cross-function refactoring operations in classical refactoring books, such as Self Encapsulate Field, Decompose Conditional Expression, Hide Delegate, Preserve Whole Object, etc. |
format |
text |
author |
MILEA, Narcisa Andreea JIANG, Lingxiao KHOO, Siau-Cheng |
author_facet |
MILEA, Narcisa Andreea JIANG, Lingxiao KHOO, Siau-Cheng |
author_sort |
MILEA, Narcisa Andreea |
title |
Scalable detection of missed cross-function refactorings |
title_short |
Scalable detection of missed cross-function refactorings |
title_full |
Scalable detection of missed cross-function refactorings |
title_fullStr |
Scalable detection of missed cross-function refactorings |
title_full_unstemmed |
Scalable detection of missed cross-function refactorings |
title_sort |
scalable detection of missed cross-function refactorings |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2014 |
url |
https://ink.library.smu.edu.sg/sis_research/2642 https://ink.library.smu.edu.sg/context/sis_research/article/3642/viewcontent/issta14refactoring.pdf |
_version_ |
1770572535032709120 |