کد مقاله کد نشریه سال انتشار مقاله انگلیسی نسخه تمام متن
461268 696581 2011 26 صفحه PDF دانلود رایگان
عنوان انگلیسی مقاله ISI
Identification of extract method refactoring opportunities for the decomposition of methods
موضوعات مرتبط
مهندسی و علوم پایه مهندسی کامپیوتر شبکه های کامپیوتری و ارتباطات
پیش نمایش صفحه اول مقاله
Identification of extract method refactoring opportunities for the decomposition of methods
چکیده انگلیسی

The extraction of a code fragment into a separate method is one of the most widely performed refactoring activities, since it allows the decomposition of large and complex methods and can be used in combination with other code transformations for fixing a variety of design problems. Despite the significance of Extract Method refactoring towards code quality improvement, there is limited support for the identification of code fragments with distinct functionality that could be extracted into new methods. The goal of our approach is to automatically identify Extract Method refactoring opportunities which are related with the complete computation of a given variable (complete computation slice) and the statements affecting the state of a given object (object state slice). Moreover, a set of rules regarding the preservation of existing dependences is proposed that exclude refactoring opportunities corresponding to slices whose extraction could possibly cause a change in program behavior. The proposed approach has been evaluated regarding its ability to capture slices of code implementing a distinct functionality, its ability to resolve existing design flaws, its impact on the cohesion of the decomposed and extracted methods, and its ability to preserve program behavior. Moreover, precision and recall have been computed employing the refactoring opportunities found by independent evaluators in software that they developed as a golden set.


► Our approach automatically identifies Extract Method refactoring opportunities.
► The identified refactoring opportunities refer to either the complete computation of a variable or the statements affecting the state of an object.
► We define a set of rules for the preservation of program behavior and the extraction of meaningful refactoring opportunities.
► Several program analysis techniques are adopted in order to improve the precision of the resulting slices.
► The suggestions of the proposed approach match the refactoring opportunities identified by human expertise to a large extent.

ناشر
Database: Elsevier - ScienceDirect (ساینس دایرکت)
Journal: Journal of Systems and Software - Volume 84, Issue 10, October 2011, Pages 1757–1782
نویسندگان
, ,