Refactoring Opportunity Identification Methodology for Removing Long Method Smells and Improving Code Analyzability

被引:4
|
作者
Meananeatra, Panita [1 ]
Rongviriyapanish, Songsakdi [1 ]
Apiwattanapong, Taweesup [2 ]
机构
[1] Thammasat Univ, Comp Sci Dept, Bangkok 1785990, Thailand
[2] Natl Sci & Technol Dev Agcy, Khlong Luang, Pathum Thani, Thailand
来源
关键词
code analyzability; long method bad smell; refactoring; software engineering; software maintenance;
D O I
10.1587/transinf.2017KBP0026
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
An important step for improving software analyzability is applying refactorings during the maintenance phase to remove bad smells, especially the long method bad smell. Long method bad smell occurs most frequently and is a root cause of other bad smells. However, no research has proposed an approach to repeating refactoring identification, suggestion, and application until all long method bad smells have been removed completely without reducing software analyzability. This paper proposes an effective approach to identifying refactoring opportunities and suggesting an effective refactoring set for complete removal of long method bad smell without reducing code analyzability. This approach, called the long method remover or LMR, uses refactoring enabling conditions based on program analysis and code metrics to identify four refactoring techniques and uses a technique embedded in JDeodorant to identify extract method. For effective refactoring set suggestion, LMR uses two criteria: code analyzability level and the number of statements impacted by the refactorings. LMR also uses side effect analysis to ensure behavior preservation. To evaluate LMR, we apply it to the core package of a real world Java application. Our evaluation criteria are 1) the preservation of code functionality, 2) the removal rate of long method characteristics, and 3) the improvement on analyzability. The result showed that the methods that apply suggested refactoring sets can completely remove long method bad smell, still have behavior preservation, and have not decreased analyzability. It is concluded that LMR meets the objectives in almost all classes. We also discussed the issues we found during evaluation as lesson learned.
引用
收藏
页码:1766 / 1779
页数:14
相关论文
共 9 条
  • [1] Identification and Refactoring of Exception Handling Code Smells in Java']JavaScript
    Hsieh, Chin-Yun
    Canh Le My
    Kim Thoa Ho
    Cheng, Yu Chin
    JOURNAL OF INTERNET TECHNOLOGY, 2017, 18 (06): : 1461 - 1471
  • [2] A probabilistic-based approach for automatic identification and refactoring of software code smells
    Saheb-Nassagh, Raana
    Ashtiani, Mehrdad
    Minaei-Bidgoli, Behrouz
    APPLIED SOFT COMPUTING, 2022, 130
  • [3] Improving the Identification of Code Smells by Combining Structural and Semantic Information
    Hadj-Kacem, Mouna
    Bouassida, Nadia
    NEURAL INFORMATION PROCESSING (ICONIP 2019), PT IV, 2019, 1142 : 296 - 304
  • [4] Reducing Subjectivity in Code Smells Detection: Experimenting with the Long Method
    Bryton, Sergio
    Brito e Abreu, Fernando
    Monteiro, Miguel
    QUATIC 2010: SEVENTH INTERNATIONAL CONFERENCE ON THE QUALITY OF INFORMATION AND COMMUNICATIONS TECHNOLOGY, 2010, : 337 - 342
  • [5] An automated extract method refactoring approach to correct the long method code smell
    Shahidi, Mahnoosh
    Ashtiani, Mehrdad
    Zakeri-Nasrabadi, Morteza
    JOURNAL OF SYSTEMS AND SOFTWARE, 2022, 187
  • [6] Software Code Bloats and Security Identification Model Based on Mikado Methodology: a Refactoring Practice
    Gandomani, Taghi Javdani
    Sichani, Hamid Shabani
    Neysiani, Behzad Soleimani
    JORDAN JOURNAL OF ELECTRICAL ENGINEERING, 2023, 9 (02): : 125 - 148
  • [7] When More Heads Are Better than One? Understanding and Improving Collaborative Identification of Code Smells
    Oliveira, Roberto
    2016 IEEE/ACM 38TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C), 2016, : 879 - 882
  • [8] Automatic detection of Long Method and God Class code smells through neural source code embeddings
    Kovacevic, Aleksandar
    Slivka, Jelena
    Vidakovic, Dragan
    Grujic, Katarina-Glorija
    Luburic, Nikola
    Prokic, Simona
    Sladic, Goran
    EXPERT SYSTEMS WITH APPLICATIONS, 2022, 204
  • [9] Channel identification and signal separation for long-code CDMA systems using multistep linear prediction method
    Li, TT
    Ding, Z
    Tugnait, JK
    Liang, WG
    2004 IEEE INTERNATIONAL CONFERENCE ON COMMUNICATIONS, VOLS 1-7, 2004, : 2437 - 2441