Suppr超能文献

设计模式与代码异味关系的实证研究。

Empirical study of the relationship between design patterns and code smells.

机构信息

Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada.

Information and Computer Science Department, King Fahd University of Petroleum and Minerals, Dhahran, Saudi Arabia.

出版信息

PLoS One. 2020 Apr 16;15(4):e0231731. doi: 10.1371/journal.pone.0231731. eCollection 2020.

Abstract

Software systems are often developed in such a way that good practices in the object-oriented paradigm are not met, causing the occurrence of specific disharmonies which are sometimes called code smells. Design patterns catalogue best practices for developing object-oriented software systems. Although code smells and design patterns are widely divergent, there might be a co-occurrence relation between them. The objective of this paper is to empirically evaluate if the presence of design patterns is related to the presence of code smells at different granularity levels. We performed an empirical study using 20 design patterns and 13 code smells in ten small-size to medium-size, open source Java-based systems. We applied statistical analysis and association rules. Results confirm that classes participating in design patterns have less smell-proneness and smell frequency than classes not participating in design patterns. We also noticed that every design pattern category act in the same way in terms of smell-proneness in the subject systems. However, we observed, based on the association rules learning and the proposed validation technique, that some patterns may be associated with certain smells in some cases. For instance, Command patterns can co-occur with God Class, Blob and External Duplication smell.

摘要

软件系统的开发方式常常不符合面向对象范式的良好实践,从而导致出现特定的不和谐现象,这些不和谐现象有时被称为代码异味。设计模式目录中收录了开发面向对象软件系统的最佳实践。尽管代码异味和设计模式有很大的不同,但它们之间可能存在共现关系。本文的目的是通过实证评估,确定在不同的粒度级别上,设计模式的存在是否与代码异味的存在相关。我们使用了 20 个设计模式和 13 个代码异味,在十个小型到中型的、基于 Java 的开源系统中进行了实证研究。我们应用了统计分析和关联规则。结果证实,参与设计模式的类比不参与设计模式的类具有更少的异味倾向和异味频率。我们还注意到,每个设计模式类别在主题系统中对于异味倾向的作用方式是相同的。然而,根据关联规则学习和提出的验证技术,我们观察到某些模式在某些情况下可能与某些异味相关。例如,命令模式可能与上帝类、Blob 和外部重复异味共现。

https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/6381936d36ca/pone.0231731.g001.jpg

文献AI研究员

20分钟写一篇综述,助力文献阅读效率提升50倍。

立即体验

用中文搜PubMed

大模型驱动的PubMed中文搜索引擎

马上搜索

文档翻译

学术文献翻译模型,支持多种主流文档格式。

立即体验