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

特征图:一种可理解的设计模式检测软件表示

Feature Maps: A Comprehensible Software Representation for Design Pattern Detection

Hannes Thaller, Lukas Linsbauer, Alexander Egyed

摘要:

设计模式是针对经常出现的软件开发问题的优雅且经过良好测试的解决方案。它们是软件开发人员处理经常发生的问题的结果,以相同或稍微调整的方式解决它们。模式的语义提供了意图、动机和适用性,描述了它做什么,为什么需要它,以及它在哪里有用。因此,设计模式编码了大量的信息。每当开发人员使用设计模式解决问题时,他们都会将这些信息编织到他们的系统中。这项工作提出了功能地图,一个灵活的人类和机器可理解的软件表示的基础上微结构。我们的算法,特征角色归一化,按高维,不均匀的向量空间的微结构到一个特征图。我们将这些概念应用到检测源代码中设计模式实例的问题中。我们对四种设计模式、广泛的平衡和不平衡标记训练数据进行了评估,并将经典机器学习(随机森林)与现代深度学习方法(卷积神经网络)进行了比较。特征映射产生强大的分类器,即使在具有挑战性的设置下,强烈不平衡的数据分布,而不牺牲人类的理解。结果表明,特征图是软件分析工具箱中的一个很好的补充,可以揭示隐藏在源代码中的有用信息。

英文摘要:

Design patterns are elegant and well-tested solutions to recurrent software development problems. They are the result of software developers dealing with problems that frequently occur, solving them in the same or a slightly adapted way. A pattern's semantics provide the intent, motivation, and applicability, describing what it does, why it is needed, and where it is useful. Consequently, design patterns encode a well of information. Developers weave this information into their systems whenever they use design patterns to solve problems. This work presents Feature Maps, a flexible human- and machine-comprehensible software representation based on micro-structures. Our algorithm, the Feature-Role Normalization, presses the high-dimensional, inhomogeneous vector space of micro-structures into a feature map. We apply these concepts to the problem of detecting instances of design patterns in source code. We evaluate our methodology on four design patterns, a wide range of balanced and imbalanced labeled training data, and compare classical machine learning (Random Forests) with modern deep learning approaches (Convolutional Neural Networks). Feature maps yield robust classifiers even under challenging settings of strongly imbalanced data distributions without sacrificing human comprehensibility. Results suggest that feature maps are an excellent addition in the software analysis toolbox that can reveal useful information hidden in the source code.

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

↑