首页 | 本学科首页   官方微博 | 高级检索  
     

一种基于深度学习的上帝类检测方法
引用本文:卜依凡,刘辉,李光杰.一种基于深度学习的上帝类检测方法[J].软件学报,2019,30(5):1359-1374.
作者姓名:卜依凡  刘辉  李光杰
作者单位:北京理工大学 计算机学院, 北京 100081,北京理工大学 计算机学院, 北京 100081,北京理工大学 计算机学院, 北京 100081
基金项目:国家重点研发计划(2016YFB1000801);国家自然科学基金(61690205,61772071,61472034)
摘    要:上帝类是指某个承担了本应由多个类分别承担的多个职责的类.上帝类违背了分而治之的基本思想以及单一职责的设计原则,严重影响软件的可维护性和可理解性.但上帝类又是一种比较常见的代码坏味.因此,针对上帝类的检测与重构一直是代码重构领域的研究热点之一.为此,提出了一种基于深度神经网络的上帝类检测方法.该方法不仅利用了常见的软件度量,而且充分利用了代码中的文本信息,意图通过挖掘文本语义揭示每个类所承担的主要角色.此外,为了解决有监督深度学习所需的海量标签数据,提出了一种基于开源代码构造标签数据的方法.最后,基于开源数据集对所提出的方法进行了实验验证.实验结果表明,这些方法优于现有的上帝类检测方法,尤其是在查全率上有大幅度的提升(提高了35.58%).

关 键 词:代码坏味  软件重构  深度学习
收稿时间:2018/8/31 0:00:00
修稿时间:2018/10/31 0:00:00

God Class Detection Approach Based on Deep Learning
BU Yi-Fan,LIU Hui and LI Guang-Jie.God Class Detection Approach Based on Deep Learning[J].Journal of Software,2019,30(5):1359-1374.
Authors:BU Yi-Fan  LIU Hui and LI Guang-Jie
Affiliation:School of Computer Science and Technology, Beijing Institute of Technology, Beijing 100081, China,School of Computer Science and Technology, Beijing Institute of Technology, Beijing 100081, China and School of Computer Science and Technology, Beijing Institute of Technology, Beijing 100081, China
Abstract:God class refers to certain classes that have assumed more than one functionality, which obey the single responsibility principle and consequently impact on the maintainability and intelligibility of software system. Studies, detection and refactoring included, of god class have always attracted research attentions because of its commonness. As a result, a neural network based detection approach is proposed to detect god class code smell. This detection technology not only makes use of common metrics in software, but also exploits the textual information in source code, which is intended to reveal the main roles that the class plays through mining text semantics. In addition, in order to solve the massive labeled data required for supervised deep learning, an approach is proposed to construct labeled data based on open source code. Finally, the proposed approach is evaluated on an open source data set. The result of evaluation shows that the proposed approach outperforms the current method, especially the recall has been greatly improved by 35.58%.
Keywords:code smell  software refactoring  deep learning
点击此处可从《软件学报》浏览原始摘要信息
点击此处可从《软件学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号