Multi-Criteria Code Refactoring Using Search-Based Software Engineering: An Industrial Case Study

被引:94
|
作者
Ouni, Ali [1 ]
Kessentini, Marouane [2 ]
Sahraoui, Houari [3 ]
Inoue, Katsuro [1 ]
Deb, Kalyanmoy [4 ]
机构
[1] Osaka Univ, Suita, Osaka 565, Japan
[2] Univ Michigan Dearborn, Dearborn, MI USA
[3] Univ Montreal, Montreal, PQ H3C 3J7, Canada
[4] Michigan State Univ, E Lansing, MI 48824 USA
基金
日本学术振兴会;
关键词
Search-based software engineering; refactoring; software maintenance; multi-objective optimization; software evolution; DESIGN QUALITY; BAD SMELLS; IDENTIFICATION; OPPORTUNITIES;
D O I
10.1145/2932631
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
One of the most widely used techniques to improve the quality of existing software systems is refactoring-the process of improving the design of existing code by changing its internal structure without altering its external behavior. While it is important to suggest refactorings that improve the quality and structure of the system, many other criteria are also important to consider, such as reducing the number of code changes, preserving the semantics of the software design and not only its behavior, and maintaining consistency with the previously applied refactorings. In this article, we propose a multi-objective search-based approach for automating the recommendation of refactorings. The process aims at finding the optimal sequence of refactorings that (i) improves the quality by minimizing the number of design defects, (ii) minimizes code changes required to fix those defects, (iii) preserves design semantics, and (iv) maximizes the consistency with the previously code changes. We evaluated the efficiency of our approach using a benchmark of six open-source systems, 11 different types of refactorings (move method, move field, pull up method, pull up field, push down method, push down field, inline class, move class, extract class, extract method, and extract interface) and six commonly occurring design defect types (blob, spaghetti code, functional decomposition, data class, shotgun surgery, and feature envy) through an empirical study conducted with experts. In addition, we performed an industrial validation of our technique, with 10 software engineers, on a large project provided by our industrial partner. We found that the proposed refactorings succeed in preserving the design coherence of the code, with an acceptable level of code change score while reusing knowledge from recorded refactorings applied in the past to similar contexts.
引用
收藏
页数:53
相关论文
共 50 条
  • [21] A Watershed Moment for Search-Based Software Engineering
    Ozkaya, Ipek
    IEEE SOFTWARE, 2021, 38 (04) : 3 - 6
  • [22] Guest Editorial: Search-Based Software Engineering
    Harman, Mark
    IET SOFTWARE, 2018, 12 (04) : 291 - 292
  • [23] Guest editorial: Search-based software engineering
    Fraser, Gordon
    de Souza, Jerffeson Teixeira
    EMPIRICAL SOFTWARE ENGINEERING, 2014, 19 (05) : 1421 - 1422
  • [24] High Dimensional Search-based Software Engineering: Finding Tradeoffs Among 15 Objectives for Automating Software Refactoring Using NSGA-III
    Mkaouer, Wiem
    Kessentini, Marouane
    Bechikh, Slim
    Deb, Kalyanmoy
    Cinneide, Mel O.
    GECCO'14: PROCEEDINGS OF THE 2014 GENETIC AND EVOLUTIONARY COMPUTATION CONFERENCE, 2014, : 1263 - 1270
  • [25] A Cooperative Parallel Search-Based Software Engineering Approach for Code-Smells Detection
    Kessentini, Wael
    Kessentini, Marouane
    Sahraoui, Houari
    Bechikh, Slim
    Ouni, Ali
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2014, 40 (09) : 841 - 861
  • [26] Methodology and Guidelines for Evaluating Multi-Objective Search-Based Software Engineering
    Li, Miqing
    Chen, Tao
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS, ICSE-COMPANION, 2023, : 338 - 339
  • [27] Methodology and Guidelines for Evaluating Multi-objective Search-Based Software Engineering
    Li, Miqing
    Chen, Tao
    COMPANION PROCEEDINGS OF THE 32ND ACM INTERNATIONAL CONFERENCE ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, FSE COMPANION 2024, 2024, : 707 - 709
  • [28] Software Requirements Interaction Management Using Search-Based Software Engineering Methods: A Survey
    Sodagari, Elham
    Keyvanpour, Mohammadreza
    2017 IEEE 4TH INTERNATIONAL CONFERENCE ON KNOWLEDGE-BASED ENGINEERING AND INNOVATION (KBEI), 2017, : 481 - 486
  • [29] Model refactoring by example: A multi-objective search based software engineering approach
    Ghannem, Adnane
    Kessentini, Marouane
    Hamdi, Mohammad Salah
    El Boussaidi, Ghizlane
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2018, 30 (04)
  • [30] On the preferences of quality indicators for multi-objective search algorithms in search-based software engineering
    Wu, Jiahui
    Arcaini, Paolo
    Yue, Tao
    Ali, Shaukat
    Zhang, Huihui
    EMPIRICAL SOFTWARE ENGINEERING, 2022, 27 (06)