[论文解读] The Influence of Code Smells in Efferent Neighbors on Class Stability
论文研究在考虑代码异味的相互关系和静态依赖的相互作用下,是否一个类的外向邻居中的代码异味会影响该类的稳定性,利用大规模仓库挖掘和负二项模型进行分析。
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 Java 项目中挖掘一年的提交历史。
- 检测十种代码异味(五种类级、五种方法级)并提取静态依赖以识别相互关系和交互。
- 计算类稳定性指标:来自提交差异的变更频率和变更规模。
- 使用带有项目层随机拦截和控制变量的负二项广义线性模型来建模稳定性。
- 将异味实例汇总为类级别,并在不同关系类型之间统一对待依赖的不加权处理。

实验结果
研究问题
- RQ1RQ1:焦点类中存在的代码异味的存在、数量或种类是否会影响其稳定性?
- RQ2RQ2:焦点类的外向邻居中的代码异味的存在、数量或种类是否会影响其稳定性?
- RQ3RQ3:考虑焦点类和邻居中的混杂异味,外向代码异味耦合是否会影响类的稳定性?
- RQ4RQ4:包括此类交互的计数和强度在内,外向代码异味交互是否会影响类的稳定性?
主要发现
- 由于这是一个经验研究的设计与计划,论文提出了假设而非结果的报告。
- 本研究旨在检验外向邻居中的异味是否会降低焦点类稳定性,超越焦点类内在的异味。
- 研究同时考虑变更频率和变更规模作为稳定性度量。
- 它考虑了代码异味的相互关系(同现性)和跨静态依赖的交互(异味之间的依赖关系)。
- 控制因素包括类大小和外向邻居数量,以降低混杂影响。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。