• DocumentCode
    2738971
  • Title

    Identifying Fragments to be Extracted from Long Methods

  • Author

    Yang, Limei ; Liu, Hui ; Niu, Zhendong

  • Author_Institution
    Sch. of Comput. Sci. & Technol., Beijing Inst. of Technol., Beijing, China
  • fYear
    2009
  • fDate
    1-3 Dec. 2009
  • Firstpage
    43
  • Lastpage
    49
  • Abstract
    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.
  • Keywords
    software prototyping; AutoMeD; decision-making; fragments extraction; long methods; open source project; refactoring extract method; Costs; Decision making; Prototypes; Bad; Extract Method; Long Method; Refactoring;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Engineering Conference, 2009. APSEC '09. Asia-Pacific
  • Conference_Location
    Penang
  • ISSN
    1530-1362
  • Print_ISBN
    978-0-7695-3909-6
  • Type

    conf

  • DOI
    10.1109/APSEC.2009.20
  • Filename
    5358495