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 条
  • [1] Search-based Refactoring Using Recorded Code Changes
    Ouni, Ali
    Kessentini, Marouane
    Sahraoui, Houari
    PROCEEDINGS OF THE 17TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR 2013), 2013, : 221 - 230
  • [2] Search-based refactoring for software maintenance
    O'Keeffe, Mark
    Cinneide, Mel O.
    JOURNAL OF SYSTEMS AND SOFTWARE, 2008, 81 (04) : 502 - 516
  • [3] On the Use of Machine Learning and Search-Based Software Engineering for Ill-Defined Fitness Function: A Case Study on Software Refactoring
    Amal, Boukhdhir
    Kessentini, Marouane
    Bechikh, Slim
    Dea, Josselin
    Ben Said, Lamjed
    SEARCH-BASED SOFTWARE ENGINEERING, 2014, 8636 : 31 - 45
  • [4] Search-based refactoring: an empirical study
    O'Keeffe, Mark
    Cinneide, Mel O.
    JOURNAL OF SOFTWARE MAINTENANCE AND EVOLUTION-RESEARCH AND PRACTICE, 2008, 20 (05): : 345 - 364
  • [5] Search-based software engineering
    Gutjahr, Walter J.
    Harman, Mark
    COMPUTERS & OPERATIONS RESEARCH, 2008, 35 (10) : 3049 - 3051
  • [6] Search-based software engineering
    Harman, M
    Jones, BF
    INFORMATION AND SOFTWARE TECHNOLOGY, 2001, 43 (14) : 833 - 839
  • [7] Search-Based Refactoring Detection from Source Code Revisions
    Hayashi, Shinpei
    Tsuda, Yasuyuki
    Saeki, Motoshi
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2010, E93D (04): : 754 - 762
  • [8] An Interactive and Dynamic Search-Based Approach to Software Refactoring Recommendations
    Alizadeh, Vahid
    Kessentini, Marouane
    Mkaouer, Mohamed Wiem
    Ocinneide, Mel
    Ouni, Ali
    Cai, Yuanfang
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2020, 46 (09) : 932 - 961
  • [9] On the use of many quality attributes for software refactoring: a many-objective search-based software engineering approach
    Mkaouer, Mohamed Wiem
    Kessentini, Marouane
    Bechikh, Slim
    Cinneide, Mel O.
    Deb, Kalyanmoy
    EMPIRICAL SOFTWARE ENGINEERING, 2016, 21 (06) : 2503 - 2545
  • [10] Automated Search for Good Coverage Criteria: Moving from Code Coverage to Fault Coverage Through Search-Based Software Engineering
    McMinn, Phil
    Harman, Mark
    Fraser, Gordon
    Kapfhammer, Gregory M.
    2016 IEEE/ACM 9TH INTERNATIONAL WORKSHOP ON SEARCH-BASED SOFTWARE TESTING (SBST), 2016, : 43 - 44