Model-based source code refactoring with interaction and visual cues

被引:0
作者
Hemati Moghadam, Iman [1 ,2 ]
Cinneide, Mel O. [3 ]
Sardarian, Ali [4 ]
Zarepour, Faezeh [2 ]
机构
[1] Univ Twente, Formal Methods & Tools, Enschede, Netherlands
[2] Vali E Asr Univ Rafsanjan, Dept Comp Engn, Rafsanjan, Iran
[3] Natl Univ Ireland, Sch Comp Sci, Dublin, Ireland
[4] Univ Tehran, Fac New Sci & Technol, Tehran, Iran
关键词
design exploration; interactive; model-based refactoring; search-based refactoring; visual cues; SOFTWARE; DESIGN; OPTIMIZATION; ALGORITHM;
D O I
10.1002/smr.2596
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Refactoring source code involves the developer in a myriad of program detail that can obscure the design changes that they actually wish to bring about. On the other hand, refactoring a UML model of the code makes it easier to focus on the program design, but the burdensome task of applying the refactorings to the source code is left to the developer. In an attempt to obtain the advantages of both approaches, we propose a refactoring approach where the interaction with the developer takes place at the model level, but the actual refactoring occurs on the source code itself. We call this approach model-based source code refactoring and implement it in this paper using two tools: (1) Design-Imp enables the developer to use interactive search-based design exploration to create a UML-based desired design from an initial design extracted from the source code. It also provides visual cues to improve developer comprehension during the design-level refactoring process and to help the developer to discern between promising and poor refactoring solutions. (2) Code-Imp then refactors the original source so that it has the same functional behavior as the original program, and a design close to the one produced in the design exploration phase, that is, a design that has been confirmed as "desirable" by the developer. We evaluated our approach involving interaction and visual cues with industrial developers refactoring three Java projects, comparing it with an approach using interaction without visual cues and a fully automated approach. The results show that our approach yields refactoring sequences that are more acceptable both to the individual developer and to a set of independent expert refactoring evaluators. Furthermore, our approach removed more code smells and was evaluated very positively by the experiment participants.
引用
收藏
页数:28
相关论文
共 78 条
  • [1] Abid C., 2020, 30 YEARS SOFTWARE RE
  • [2] An Interactive and Dynamic Search-Based Approach to Software Refactoring Recommendations
    Alizadeh, Vahid
    Kessentini, Marouane
    Mkaouer, Mohamed Wiem
    Ocinneide, Mel
    Ouni, Ali
    Cai, Yuanfang
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2020, 46 (09) : 932 - 961
  • [3] Alizadeh V, 2018, IEEE INT CONF AUTOM, P464, DOI [10.114513238147.3238217, 10.1145/3238147.3238217]
  • [4] [Anonymous], MOD BAS SOURC COD RE
  • [5] The impact of UML documentation on software maintenance: An experimental evaluation
    Arisholm, Erik
    Briand, Lionel C.
    Hove, Siw Elisabeth
    Labiche, Yvan
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2006, 32 (06) : 365 - 381
  • [6] A hierarchical model for object-oriented design quality assessment
    Bansiya, J
    Davis, CG
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2002, 28 (01) : 4 - 17
  • [7] Automatic software refactoring: a systematic literature review
    Baqais, Abdulrahman Ahmed Bobakr
    Alshayeb, Mohammad
    [J]. SOFTWARE QUALITY JOURNAL, 2020, 28 (02) : 459 - 502
  • [8] Bibi A., 2019, INT SYMP EMP SOFTWAR, P1, DOI DOI 10.1109/esem.2019.8870183
  • [9] Bjork RC., 2022, EXAMPLE OBJECT ORIEN
  • [10] Bourquin F, 2007, CSMR 2007: 11TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING, PROCEEDINGS, P149