• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science ›› 2021, Vol. 43 ›› Issue (04): 689-696.

Previous Articles     Next Articles

Improvement of code package level refactoring based on DBSCAN algorithm

LI Wen-hao,LI Ying-mei,BIAN Yi-xin   

  1. (School of Computer Science and Information Engineering,Harbin Normal University,Harbin 150025,China)
  • Received:2019-10-10 Revised:2020-06-08 Accepted:2021-04-25 Online:2021-04-25 Published:2021-04-21

Abstract: In the research of code refactoring at the package level, in order to obtain the software structure of "high cohesion and low coupling", the hierarchical clustering algorithm is considered to be a better software clustering algorithm because of its simple and effective characteristics and high clustering accuracy. However, the time complexity of the hierarchical clustering algorithm is high, which is not conducive to processing large-scale software. The DBSCAN algorithm, on the other hand, has faster clustering speed but lower accuracy. Therefore, a software hierarchical clustering algorithm based on DBSCAN is proposed, which uses the classes generated by the DBSCAN algorithm to constrain the clustering space of the hierarchical clustering algorithm. This algorithm can keep the accuracy of the hierarchical clustering algorithm unchanged, and its time complexity lies between DBSCAN and the hierarchical clustering algorithm. The experimental results show that the algorithm can effectively divide the software reasonably, and prove that the performance of the algorithm is better than other common clustering algorithms through expert evaluation, module division metrics and algorithm running time comparison.


Key words: DBSCAN algorithm, hierarchical clustering, software clustering, code refactoring