Methodbook: Recommending Move Method Refactorings via Relational Topic Models

被引:114
作者
Bavota, Gabriele [1 ]
Oliveto, Rocco [2 ,3 ]
Gethers, Malcom [4 ]
Poshyvanyk, Denys [5 ]
De Lucia, Andrea [6 ]
机构
[1] Univ Sannio, Dept Engn, Benevento, Italy
[2] Univ Molise, Dept Biosci & Terr, Pesche, IS, Italy
[3] Univ Molise, Lab Comp Sci & Sci Computat, Pesche, IS, Italy
[4] Univ Maryland Baltimore Cty, Dept Informat Syst, Baltimore, MD 21250 USA
[5] Coll William & Mary, Williamsburg, VA 23185 USA
[6] Univ Salerno, Dept Management & Informat Technol, Fisciano, SA, Italy
关键词
Refactoring; relational topic models; empirical studies; COHESION; VALIDATION; METRICS;
D O I
10.1109/TSE.2013.60
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
During software maintenance and evolution the internal structure of the software system undergoes continuous changes. These modifications drift the source code away from its original design, thus deteriorating its quality, including cohesion and coupling of classes. Several refactoring methods have been proposed to overcome this problem. In this paper we propose a novel technique to identify Move Method refactoring opportunities and remove the Feature Envy bad smell from source code. Our approach, coined as Methodbook, is based on relational topic models (RTM), a probabilistic technique for representing and modeling topics, documents (in our case methods) and known relationships among these. Methodbook uses RTM to analyze both structural and textual information gleaned from software to better support move method refactoring. We evaluated Methodbook in two case studies. The first study has been executed on six software systems to analyze if the move method operations suggested by Methodbook help to improve the design quality of the systems as captured by quality metrics. The second study has been conducted with eighty developers that evaluated the refactoring recommendations produced by Methodbook. The achieved results indicate that Methodbook provides accurate and meaningful recommendations for move method refactoring operations.
引用
收藏
页码:671 / 694
页数:24
相关论文
共 58 条
[11]   Mining Search Topics from a Code Search Engine Usage Log [J].
Bajracharya, Sushil ;
Lopes, Cristina .
2009 6TH IEEE INTERNATIONAL WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES, 2009, :111-120
[12]   A validation of object-oriented design metrics as quality indicators [J].
Basili, VR ;
Briand, LC ;
Melo, WL .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1996, 22 (10) :751-761
[13]  
Bavota G., 2013, TECHNICAL REPORT
[14]  
Bavota G, 2010, PROC IEEE INT CONF S
[15]   Automating extract class refactoring: an improved method and its evaluation [J].
Bavota, Gabriele ;
De Lucia, Andrea ;
Marcus, Andrian ;
Oliveto, Rocco .
EMPIRICAL SOFTWARE ENGINEERING, 2014, 19 (06) :1617-1664
[16]   Improving Software Modularization via Automated Analysis of Latent Topics and Dependencies [J].
Bavota, Gabriele ;
Gethers, Malcom ;
Oliveto, Rocco ;
Poshyvanyk, Denys ;
De Lucia, Andrea .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2014, 23 (01)
[17]   Using structural and semantic measures to improve software modularization [J].
Bavota, Gabriele ;
De Lucia, Andrea ;
Marcus, Andrian ;
Oliveto, Rocco .
EMPIRICAL SOFTWARE ENGINEERING, 2013, 18 (05) :901-932
[18]   Identifying Extract Class refactoring opportunities using structural and semantic cohesion measures [J].
Bavota, Gabriele ;
De Lucia, Andrea ;
Oliveto, Rocco .
JOURNAL OF SYSTEMS AND SOFTWARE, 2011, 84 (03) :397-414
[19]   Validation of the coupling dependency metric as a predictor of run-time failures and maintenance measures [J].
Binkley, AB ;
Schach, SR .
PROCEEDINGS OF THE 1998 INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, 1998, :452-455
[20]   Latent Dirichlet allocation [J].
Blei, DM ;
Ng, AY ;
Jordan, MI .
JOURNAL OF MACHINE LEARNING RESEARCH, 2003, 3 (4-5) :993-1022