Deriving extract method refactoring suggestions for long methods

7Citations
Citations of this article
14Readers
Mendeley users who have this article in their library.
Get full text

Abstract

The extract method is a common way to shorten long methods in software development. Before developers can use tools that support the extract method, they need to invest time in identifying a suitable refactoring candidate. This paper addresses the problem of finding the most appropriate refactoring candidate for long methods written in Java. The approach determines valid refactoring candidates and ranks them using a scoring function that aims to improve readability and reduce code complexity. We use length and nesting reduction as complexity indicators. The number of parameters needed by the candidate influences the score. To suggest candidates that are consistent with the structure of the code, information such as comments and blank lines are also considered by the scoring function. We evaluate our approach to three open source systems using a user study with ten experienced developers. Our results show that they would actually apply 86 % of suggestions for an extract method refactoring.

Cite

CITATION STYLE

APA

Haas, R., & Hummel, B. (2016). Deriving extract method refactoring suggestions for long methods. In Lecture Notes in Business Information Processing (Vol. 238, pp. 144–155). Springer Verlag. https://doi.org/10.1007/978-3-319-27033-3_10

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free