Understanding what drives code instability is essential for effective software maintenance, as unstable classes require larger or more frequent edits and increase the risk of unintended side effects. Although code smells are widely believed to harm maintainability, most prior stability studies examine only the smells within the class being modified. In practice, however, classes can change because their efferent neighbors (i.e., the classes they depend on) are modified due to ripple effects that propagate along static dependencies, even if the class itself is clean. Such ripple effects may be more severe when the efferent neighbor exhibits code smells. In addition, code smells rarely occur alone. They often appear together within a class or across classes connected by static dependencies, a phenomenon known as code smell interrelation. Such interrelation can lead to code smell interaction, where smells are directly connected through static dependencies and may further compound maintainability issues. However, the effect of code smell interrelation and interaction on code quality remains largely underexplored. Therefore, this study investigates whether the presence of code smells in a class's efferent neighbors affects its stability, considering the factor of code smell interrelation and interaction. To achieve this, we mine one year of commit history from 100 top-starred GitHub projects, detect code smells and static dependencies, determine code smell interrelation and interaction, and model these factors as predictors of class stability.


翻译:理解驱动代码不稳定性的因素对于有效的软件维护至关重要,因为不稳定的类需要更大或更频繁的编辑,并增加了意外副作用的风险。尽管代码异味被广泛认为会损害可维护性,但大多数先前的稳定性研究仅检查被修改类内部的异味。然而在实践中,类可能因其传出邻居(即它们所依赖的类)被修改而发生变化,这是由于沿着静态依赖关系传播的涟漪效应,即使该类本身是干净的。当传出邻居表现出代码异味时,这种涟漪效应可能更为严重。此外,代码异味很少单独出现。它们通常在一个类内部或通过静态依赖关系连接的类之间共同出现,这种现象被称为代码异味相互关联。这种相互关联可能导致代码异味交互,即异味通过静态依赖关系直接连接,并可能进一步加剧可维护性问题。然而,代码异味相互关联和交互对代码质量的影响在很大程度上仍未得到充分探索。因此,本研究调查了一个类的传出邻居中是否存在代码异味是否会影响其稳定性,同时考虑了代码异味相互关联和交互的因素。为实现这一目标,我们挖掘了100个顶级星标GitHub项目一年的提交历史,检测代码异味和静态依赖关系,确定代码异味的相互关联和交互,并将这些因素建模为类稳定性的预测因子。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
AI生成代码缺陷综述
专知会员服务
16+阅读 · 2025年12月8日
【ETHZ博士论文】机器学习代码: 安全性与可靠性
专知会员服务
19+阅读 · 2024年10月25日
《使用静态污点分析检测恶意代码》CMU最新30页slides
专知会员服务
21+阅读 · 2023年10月11日
专知会员服务
17+阅读 · 2021年9月8日
异质信息网络分析与应用综述,软件学报-北京邮电大学
《代码整洁之道》:5大基本要点
专知会员服务
50+阅读 · 2020年3月3日
【AAAI2021】对比聚类,Contrastive Clustering
专知
26+阅读 · 2021年1月30日
异常检测(Anomaly Detection)综述
极市平台
20+阅读 · 2020年10月24日
「PPT」深度学习中的不确定性估计
专知
27+阅读 · 2019年7月20日
异常检测论文大列表:方法、应用、综述
专知
126+阅读 · 2019年7月15日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
使用 Canal 实现数据异构
性能与架构
20+阅读 · 2019年3月4日
论文浅尝 | 基于局内去噪和迁移学习的关系抽取
开放知识图谱
16+阅读 · 2018年12月2日
时序异常检测算法概览
论智
29+阅读 · 2018年8月30日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关资讯
【AAAI2021】对比聚类,Contrastive Clustering
专知
26+阅读 · 2021年1月30日
异常检测(Anomaly Detection)综述
极市平台
20+阅读 · 2020年10月24日
「PPT」深度学习中的不确定性估计
专知
27+阅读 · 2019年7月20日
异常检测论文大列表:方法、应用、综述
专知
126+阅读 · 2019年7月15日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
使用 Canal 实现数据异构
性能与架构
20+阅读 · 2019年3月4日
论文浅尝 | 基于局内去噪和迁移学习的关系抽取
开放知识图谱
16+阅读 · 2018年12月2日
时序异常检测算法概览
论智
29+阅读 · 2018年8月30日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员