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 条
  • [11] On the Value of User Preferences in Search-Based Software Engineering: A Case Study in Software Product Lines
    Sayyad, Abdel Salam
    Menzies, Tim
    Ammar, Hany
    PROCEEDINGS OF THE 35TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2013), 2013, : 492 - 501
  • [12] On the use of many quality attributes for software refactoring: a many-objective search-based software engineering approach
    Mohamed Wiem Mkaouer
    Marouane Kessentini
    Slim Bechikh
    Mel Ó Cinnéide
    Kalyanmoy Deb
    Empirical Software Engineering, 2016, 21 : 2503 - 2545
  • [13] Model refactoring using examples: a search-based approach
    Ghannem, Adnane
    El Boussaidi, Ghizlane
    Kessentini, Marouane
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2014, 26 (07) : 692 - 713
  • [14] A systematic mapping study of search-based software engineering for software product lines
    Lopez-Herrejon, Roberto E.
    Linsbauer, Lukas
    Egyed, Alexander
    INFORMATION AND SOFTWARE TECHNOLOGY, 2015, 61 : 33 - 51
  • [15] To Preserve or Not to Preserve Invalid Solutions in Search-Based Software Engineering: A Case Study in Software Product Lines
    Guo, Jianmei
    Shi, Kai
    PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2018, : 1027 - 1038
  • [16] Optimizing the Software Testing Problem Using Search-Based Software Engineering Techniques
    Ben Zayed, Hissah A.
    Maashi, Mashael S.
    INTELLIGENT AUTOMATION AND SOFT COMPUTING, 2021, 29 (01): : 307 - 318
  • [17] Special Issue on Search-Based Software Engineering
    Sarro, Federica
    Kessentini, Marouane
    Deb, Kalayanmoy
    IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, 2018, 22 (03) : 333 - 333
  • [18] Search-based software engineering for maintenance and reengineering
    Harman, Mark
    10th European Conference on Software Maintenance and Reengineering, Proceedings, 2006, : 309 - 309
  • [19] Multi-Criteria Strategy-based Refactoring Selection
    Chisalita-Cretu, Camelia
    PROCEEDINGS OF THE 9TH INTERNATIONAL CONFERENCE ON VIRTUAL LEARNING, 2014, : 329 - 336
  • [20] Guest editorial: Search-based software engineering
    Gordon Fraser
    Jerffeson Teixeira de Souza
    Empirical Software Engineering, 2014, 19 : 1421 - 1422