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 条
  • [31] On the preferences of quality indicators for multi-objective search algorithms in search-based software engineering
    Jiahui Wu
    Paolo Arcaini
    Tao Yue
    Shaukat Ali
    Huihui Zhang
    Empirical Software Engineering, 2022, 27
  • [32] Editorial for the Special Issue on Search-based Software Engineering
    Bate, Iain
    Poulding, Simon
    SOFTWARE-PRACTICE & EXPERIENCE, 2011, 41 (05): : 467 - 468
  • [33] A Systematic Review of Interaction in Search-Based Software Engineering
    Ramirez, Aurora
    Raul Romero, Jose
    Simons, Christopher L.
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2019, 45 (08) : 760 - 781
  • [34] "Sampling" as a Baseline Optimizer for Search-Based Software Engineering
    Chen, Jianfeng
    Nair, Vivek
    Krishna, Rahul
    Menzies, Tim
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2019, 45 (06) : 597 - 614
  • [35] Beyond evolutionary algorithms for search-based software engineering
    Chen, Jianfeng
    Nair, Vivek
    Menzies, Tim
    INFORMATION AND SOFTWARE TECHNOLOGY, 2018, 95 : 281 - 294
  • [36] Search-based software engineering for constructing covering arrays
    Torres-Jimenez, Jose
    Izquierdo-Marquez, Idelfonso
    Avila-George, Himer
    IET SOFTWARE, 2018, 12 (04) : 324 - 332
  • [37] Implementing Search-Based Software Engineering Approaches with Nautilus
    Ferreira, Thiago Do Nascimento
    Vergilio, Silvia Regina
    Kessentini, Marouane
    ACM International Conference Proceeding Series, 2021, : 303 - 308
  • [38] Search-Based Software Engineering: Trends, Techniques and Applications
    Harman, Mark
    Mansouri, S. Afshin
    Zhang, Yuanyuan
    ACM COMPUTING SURVEYS, 2012, 45 (01)
  • [39] Data-Driven Search-based Software Engineering
    Nair, Vivek
    Agrawal, Amritanshu
    Chen, Jianfeng
    Fu, Wei
    Mathew, George
    Menzies, Tim
    Minku, Leandro
    Wagner, Markus
    Yu, Zhe
    2018 IEEE/ACM 15TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR), 2018, : 341 - 352
  • [40] Applications of Multi-criteria Decision Making in Software Engineering
    Sehra, Sumeet Kaur
    Brar, Yadwinder Singh
    Kaur, Navdeep
    INTERNATIONAL JOURNAL OF ADVANCED COMPUTER SCIENCE AND APPLICATIONS, 2016, 7 (07) : 472 - 477