跳到主要导航 跳到搜索 跳到主要内容

Identifying fragments to be extracted from long methods

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

Long and complex methods are hard to read or maintain, and thus usually treated as bad smells, known as Long Method. On the contrary, short and well-named methods are much easier to read, maintain, and extend. In order to divide long methods into short ones, refactoring Extract Method was proposed and has been widely used. However, extracting methods manually is time consuming and error prone. Though existing refactoring tools can automatically extract a selected fragment from its inclosing method, which fragment within a long method should be extracted has to be determined manually. In order to facilitate the decision-making, we propose an approach to recommend fragments within long methods for extraction. The approach is implemented as a prototype, called AutoMeD. With the tool, we evaluate the approach on a nontrivial open source project. The evaluation results suggest that refactoring cost of long methods can be reduced by nearly 40%. The main contribution of this paper is an approach to recommending fragments within long methods to be extracted, as well as an initial evaluation of the approach.

源语言英语
主期刊名Proceedings - 16th Asia-Pacific Software Engineering Conference, APSEC 2009
43-49
页数7
DOI
出版状态已出版 - 2009
活动16th Asia-Pacific Software Engineering Conference, APSEC 2009 - Penang, 马来西亚
期限: 1 12月 20093 12月 2009

出版系列

姓名Proceedings - Asia-Pacific Software Engineering Conference, APSEC
ISSN(印刷版)1530-1362

会议

会议16th Asia-Pacific Software Engineering Conference, APSEC 2009
国家/地区马来西亚
Penang
时期1/12/093/12/09

指纹

探究 'Identifying fragments to be extracted from long methods' 的科研主题。它们共同构成独一无二的指纹。

引用此