arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1910.07658cs.SE
收藏

代码重写历史中的深度学习反模式

Deep Learning Anti-patterns from Code Metrics History

Antoine Barbez, Foutse Khomh, Yann-Gaël Guéhéneuc

摘要:

反模式对于反复出现的设计问题来说是一个糟糕的解决方案。大量的实证研究强调了反模式对软件维护的负面影响,这促使了各种检测技术的发展。这些方法中的大多数依赖于软件系统的结构度量来识别受影响的组件,而其他方法则通过分析代码组件之间发生的共同变化来利用历史信息。通过仅仅依赖于软件系统的一个方面(即,结构的或历史的),现有的方法错过了一些宝贵的信息,这限制了它们的性能。在本文中,我们提出了CAME(代码卷积分析演化),这是一种基于深度学习的方法,它依赖于结构和历史信息来检测反模式。我们的方法利用从版本控制系统中挖掘的结构代码度量的历史值,并使用卷积神经网络分类器从这些信息中推断反模式的存在。我们实验我们的方法,广为人知的上帝类反模式,并评估其性能的三个软件系统。通过我们的研究结果,我们表明:(1)使用源代码指标的历史值可以提高精度;(2)CAME优于现有的静态机器学习分类器;(3)CAME优于现有的检测工具。

英文摘要:

Anti-patterns are poor solutions to recurring design problems. Number of empirical studies have highlighted the negative impact of anti-patterns on software maintenance which motivated the development of various detection techniques. Most of these approaches rely on structural metrics of software systems to identify affected components while others exploit historical information by analyzing co-changes occurring between code components. By relying solely on one aspect of software systems (i.e., structural or historical), existing approaches miss some precious information which limits their performances. In this paper, we propose CAME (Convolutional Analysis of code Metrics Evolution), a deep-learning based approach that relies on both structural and historical information to detect anti-patterns. Our approach exploits historical values of structural code metrics mined from version control systems and uses a Convolutional Neural Network classifier to infer the presence of anti-patterns from this information. We experiment our approach for the widely known God Class anti-pattern and evaluate its performances on three software systems. With the results of our study, we show that: (1) using historical values of source code metrics allows to increase the precision; (2) CAME outperforms existing static machine-learning classifiers; and (3) CAME outperforms existing detection tools.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑