• 文献检索
  • 文档翻译
  • 深度研究
  • 学术资讯
  • Suppr Zotero 插件Zotero 插件
  • 邀请有礼
  • 套餐&价格
  • 历史记录
应用&插件
Suppr Zotero 插件Zotero 插件浏览器插件Mac 客户端Windows 客户端微信小程序
定价
高级版会员购买积分包购买API积分包
服务
文献检索文档翻译深度研究API 文档MCP 服务
关于我们
关于 Suppr公司介绍联系我们用户协议隐私条款
关注我们

Suppr 超能文献

核心技术专利:CN118964589B侵权必究
粤ICP备2023148730 号-1Suppr @ 2026

文献检索

告别复杂PubMed语法,用中文像聊天一样搜索,搜遍4000万医学文献。AI智能推荐,让科研检索更轻松。

立即免费搜索

文件翻译

保留排版,准确专业,支持PDF/Word/PPT等文件格式,支持 12+语言互译。

免费翻译文档

深度研究

AI帮你快速写综述,25分钟生成高质量综述,智能提取关键信息,辅助科研写作。

立即免费体验

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

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.

DOI:10.1371/journal.pone.0231731
PMID:32298360
原文链接:https://pmc.ncbi.nlm.nih.gov/articles/PMC7162509/
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/9069c6a02223/pone.0231731.g009.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/6381936d36ca/pone.0231731.g001.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/86c862510607/pone.0231731.g002.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/c2239a2a03ed/pone.0231731.g003.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/09c94eed31c4/pone.0231731.g004.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/683094c8f13f/pone.0231731.g005.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/c7fc19cc970c/pone.0231731.g006.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/7bfbb54872ab/pone.0231731.g007.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/836a96592900/pone.0231731.g008.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/9069c6a02223/pone.0231731.g009.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/6381936d36ca/pone.0231731.g001.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/86c862510607/pone.0231731.g002.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/c2239a2a03ed/pone.0231731.g003.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/09c94eed31c4/pone.0231731.g004.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/683094c8f13f/pone.0231731.g005.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/c7fc19cc970c/pone.0231731.g006.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/7bfbb54872ab/pone.0231731.g007.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/836a96592900/pone.0231731.g008.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/c1d4/7162509/9069c6a02223/pone.0231731.g009.jpg

相似文献

1
Empirical study of the relationship between design patterns and code smells.设计模式与代码异味关系的实证研究。
PLoS One. 2020 Apr 16;15(4):e0231731. doi: 10.1371/journal.pone.0231731. eCollection 2020.
2
Integration of design smells and role-stereotypes classification dataset.设计坏味道与角色刻板印象分类数据集的整合。
Data Brief. 2021 May 8;36:107125. doi: 10.1016/j.dib.2021.107125. eCollection 2021 Jun.
3
Python code smells detection using conventional machine learning models.使用传统机器学习模型检测Python代码异味。
PeerJ Comput Sci. 2023 May 29;9:e1370. doi: 10.7717/peerj-cs.1370. eCollection 2023.
4
Dynamic stacking ensemble for cross-language code smell detection.用于跨语言代码异味检测的动态堆叠集成方法。
PeerJ Comput Sci. 2024 Aug 15;10:e2254. doi: 10.7717/peerj-cs.2254. eCollection 2024.
5
A study of dealing class imbalance problem with machine learning methods for code smell severity detection using PCA-based feature selection technique.一项使用基于主成分分析(PCA)的特征选择技术,运用机器学习方法处理代码异味严重程度检测中的类别不平衡问题的研究。
Sci Rep. 2023 Sep 27;13(1):16245. doi: 10.1038/s41598-023-43380-8.
6
An object-oriented programming system for the integration of internet-based bioinformatics resources.一种用于整合基于互联网的生物信息学资源的面向对象编程系统。
Appl Bioinformatics. 2006;5(1):29-39. doi: 10.2165/00822942-200605010-00004.
7
Software Code Smell Prediction Model Using Shannon, Rényi and Tsallis Entropies.使用香农熵、雷尼熵和Tsallis熵的软件代码异味预测模型
Entropy (Basel). 2018 May 17;20(5):372. doi: 10.3390/e20050372.
8
On the adequacy of static analysis warnings with respect to code smell prediction.关于静态分析警告在代码异味预测方面的充分性。
Empir Softw Eng. 2022;27(3):64. doi: 10.1007/s10664-022-10126-5. Epub 2022 Mar 17.
9
A Developer-Oriented Framework for Assessing Power Consumption in Mobile Applications: Android Energy Smells Case Study.一种面向开发者的移动应用功耗评估框架:安卓能量嗅探案例研究
Sensors (Basel). 2024 Oct 7;24(19):6469. doi: 10.3390/s24196469.
10
MFV-class: a multi-faceted visualization tool of object classes.MFV 类:一种多方面的对象类可视化工具。
J Zhejiang Univ Sci. 2004 Nov;5(11):1374-81. doi: 10.1631/jzus.2004.1374.

引用本文的文献

1
A how-to guide for code sharing in biology.生物学代码共享指南
PLoS Biol. 2024 Sep 10;22(9):e3002815. doi: 10.1371/journal.pbio.3002815. eCollection 2024 Sep.