Code Smell Detection Using Whale Optimization Algorithm

被引:9
|
作者
Draz, Moatasem M. [1 ]
Farhan, Marwa S. [2 ,3 ]
Abdulkader, Sarah N. [4 ,5 ]
Gafar, M. G. [6 ,7 ]
机构
[1] Kafrelsheikh Univ, Fac Comp & Informat, Dept Software Engn, Kafr Al Sheikh, Egypt
[2] British Univ Egypt, Fac Informat & Comp Sci, Cairo, Egypt
[3] Helwan Univ, Fac Comp & Artificial Intelligence, Dept Informat Syst, Cairo, Egypt
[4] Helwan Univ, Fac Comp & Artificial Intelligence, Dept Comp Sci, Cairo, Egypt
[5] Arab Open Univ, Fac Comp Studies, Cairo, Egypt
[6] Prince Sattam Bin Abdulaziz Univ, Coll Sci & Humanities Al Sulail, Dept Comp Sci, Kharj, Saudi Arabia
[7] Kafrelsheikh Univ, Fac Artificial Intelligence, Dept Machine Learning & Informat Retrieval, Kafr Al Sheikh, Egypt
来源
CMC-COMPUTERS MATERIALS & CONTINUA | 2021年 / 68卷 / 02期
关键词
Software engineering intelligence; search-based software engineering; code smell detection; software metrics; whale optimization algorithm; fisher criterion; SOFTWARE; DEFECTS; BAD;
D O I
10.32604/cmc.2021.015586
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Software systems have been employed in many fields as a means to reduce human efforts; consequently, stakeholders are interested in more updates of their capabilities. Code smells arise as one of the obstacles in the software industry. They are characteristics of software source code that indicate a deeper problem in design. These smells appear not only in the design but also in software implementation. Code smells introduce bugs, affect software maintainability, and lead to higher maintenance costs. Uncovering code smells can be formulated as an optimization problem of finding the best detection rules. Although researchers have recommended different techniques to improve the accuracy of code smell detection, these methods are still unstable and need to be improved. Previous research has sought only to discover a few at a time (three or five types) and did not set rules for detecting their types. Our research improves code smell detection by applying a search-based technique; we use the Whale Optimization Algorithm as a classifier to find ideal detection rules. Applying this algorithm, the Fisher criterion is utilized as a fitness function to maximize the between-class distance over the within class variance. The proposed framework adopts if-then detection rules during the software development life cycle. Those rules identify the types for both medium and large projects. Experiments are conducted on five open-source software projects to discover nine smell types that mostly appear in codes. The proposed detection framework has an average of 94.24% precision and 93.4% recall. These accurate values are better than other search-based algorithms of the same field. The proposed framework improves code smell detection, which increases software quality while minimizing maintenance effort, time, and cost. Additionally, the resulting classification rules are analyzed to find the software metrics that differentiate the nine code smells.
引用
收藏
页码:1919 / 1935
页数:17
相关论文
共 50 条
  • [1] Stance detection using improved whale optimization algorithm
    Avinash Chandra Pandey
    Vinay Anand Tikkiwal
    [J]. Complex & Intelligent Systems, 2021, 7 : 1649 - 1672
  • [2] Stance detection using improved whale optimization algorithm
    Pandey, Avinash Chandra
    Tikkiwal, Vinay Anand
    [J]. COMPLEX & INTELLIGENT SYSTEMS, 2021, 7 (03) : 1649 - 1672
  • [4] Using Developers' Feedback to Improve Code Smell Detection
    Hozano, Mario
    Ferreira, Henrique
    Silva, Italo
    Fonseca, Baldoino
    Costa, Evandro
    [J]. 30TH ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING, VOLS I AND II, 2015, : 1661 - 1663
  • [5] Optimization of Rendezvous Orbit Using Whale Optimization Algorithm
    Shim, Eun-Song
    Kim, Hae-Dong
    Lee, Seonho
    [J]. JOURNAL OF THE KOREAN SOCIETY FOR AERONAUTICAL AND SPACE SCIENCES, 2023, 51 (01) : 67 - 74
  • [6] A Novel Method for Anomaly Detection in the Internet of Things using Whale Optimization Algorithm
    Zhu, Zhihui
    Zhu, Meifang
    [J]. INTERNATIONAL JOURNAL OF ADVANCED COMPUTER SCIENCE AND APPLICATIONS, 2023, 14 (05) : 765 - 773
  • [7] Mango Pest Detection Using Entropy-ELM with Whale Optimization Algorithm
    Muthaiah, U.
    Chitra, S.
    [J]. INTELLIGENT AUTOMATION AND SOFT COMPUTING, 2023, 35 (03): : 3447 - 3458
  • [8] Detection of Lung Tumor Using ASPP-Unet with Whale Optimization Algorithm
    Alkhonaini, Mimouna Abdullah
    Hassine, Siwar Ben Haj
    Obayya, Marwa
    Al-Wesabi, Fahd N.
    Hilal, Anwer Mustafa
    Hamza, Manar Ahmed
    Motwakel, Abdelwahed
    Al Duhayyim, Mesfer
    [J]. CMC-COMPUTERS MATERIALS & CONTINUA, 2022, 72 (02): : 3511 - 3527
  • [9] Opinion leader detection using whale optimization algorithm in online social network
    Jain, Lokesh
    Katarya, Rahul
    Sachdeva, Shelly
    [J]. EXPERT SYSTEMS WITH APPLICATIONS, 2020, 142 (142)
  • [10] WOCDA: A whale optimization based community detection algorithm
    Zhang, Yun
    Liu, Yongguo
    Li, Jieting
    Zhu, Jiajing
    Yang, Changhong
    Yang, Wen
    Wen, Chuanbiao
    [J]. PHYSICA A-STATISTICAL MECHANICS AND ITS APPLICATIONS, 2020, 539