A DQN-based agent for automatic software refactoring

被引:5
作者
Ahmadi, Hamidreza [1 ]
Ashtiani, Mehrdad [1 ]
Azgomi, Mohammad Abdollahi [1 ]
Saheb-Nassagh, Raana [1 ]
机构
[1] Iran Univ Sci & Technol, Sch Comp Engn, Hengam St,Resalat Sq, Tehran 1684613114, Iran
关键词
Software refactoring; Design patterns; Technical debt; Software metrics; Reinforcement learning;
D O I
10.1016/j.infsof.2022.106893
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context: Nowadays, technical debt has become a very important issue in software project management. The main mechanism to repay this debt is through refactoring. Refactoring software projects usually comes at a high cost. As a result, researchers have always looked for ways to minimize this cost, and a good potential candidate to reduce the cost of a process is to automate it. Objective: One of the automatic software refactoring methods that recently has received a lot of attention is based on search-based software engineering (SBSE) methods. Although because of comprehensiveness and versatility SBSE is considered an appropriate method for automatic refactoring, it has its downsides, the most important of which are the uncertainty of the results and the exponential execution time. Method: In this research, a solution is proposed inspired by search-based refactoring while taking advantage of exploitation in reinforcement learning techniques. This work aims to solve the uncertainty problems and execution time for large programs. In the proposed approach, the problem of uncertainty is solved by targeting the selection of refactoring actions used in the search-based approach. Also, due to the reduction of the dependency between the choice of the appropriate refactoring and its execution time, the time problem in large software refactoring has been greatly improved. Results: Amongst the performed evaluations and specifically for the refactoring of the largest case study, the proposed approach managed to increase the accuracy to more than twice of the SBSE refactoring approaches, while reducing the execution time of refactoring by more than 98%. Conclusion: The results of the tests show that with increasing the volume and size of the software, the performance of the proposed approach also improves compared to the methods based on SBSE, both in terms of reducing technical debt and speeding up the refactoring process.
引用
收藏
页数:21
相关论文
共 28 条
[1]  
Ahmadi Hamidreza, HRAHMADI71A CMA EXPT
[2]  
Alizadeh V, 2018, IEEE INT CONF AUTOM, P464, DOI [10.114513238147.3238217, 10.1145/3238147.3238217]
[3]  
Avgeriou P., 2016, DAGSTUHL REPORTS, V6
[4]   A hierarchical model for object-oriented design quality assessment [J].
Bansiya, J ;
Davis, CG .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2002, 28 (01) :4-17
[5]  
Bloch J., 2017, Effective Java
[6]  
Cunningham W., 1993, OOPS Messenger, V4, P29
[7]  
Fowler M., 2018, REFACTORING IMPROVIN
[8]  
Gaoa Y., 2020, PROTOTYPE SOFTWARE R
[9]  
Garcia J, 2009, LECT NOTES COMPUT SC, V5581, P146, DOI 10.1007/978-3-642-02351-4_10
[10]   Search-based software engineering [J].
Harman, M ;
Jones, BF .
INFORMATION AND SOFTWARE TECHNOLOGY, 2001, 43 (14) :833-839