一句话:提出 PairSmell,用多款模块化工具识别实体对的不当分离/共置,将粗粒度设计问题细化为可指导重构的模块关系缺陷。
现有模块化改造常需大幅修改原模块,而识别出的设计问题又过于粗粒度,难以指导重构。本文提出 PairSmell,聚焦模块关系(MR):一对实体应分离还是共置。若实体实际 MR 与多个模块化工具共识的“apt MR”不一致,则视为可能有缺陷的架构决策。作者在 20 个 C/C++ 与 Java 项目上,用 4 个模块化工具识别 InSep 与 InCol 两类 PairSmell。对 260,003 个实例的实证分析显示:平均 14.60% 和 20.44% 的实体分别涉及 InSep 与 InCol;InSep 对的共同变更比正确分离对多 190%,InCol 对则比正确共置对少 35%,且两类问题持续存在于软件演化中。结果表明 PairSmell 能提供细粒度、基础性的模块结构审视,提升模块化设计改进效率。
Enhancing the modular structure of existing systems has attracted substantial research interest, focusing on two main methods: (1) software modularization and (2) identifying design issues (e.g., smells) as refactoring opportunities. However, remodularization solutions often require extensive modifications to the original modules, and the design issues identified are generally too coarse to guide refactoring strategies. Combining the above two methods, this paper introduces a novel concept, PairSmell, which exploits modularization to pinpoint design issues necessitating refactoring. We concentrate on a granular but fundamental aspect of modularity principles-modular relation (MR), i.e., whether a pair of entities are separated or collocated. The main assumption is that, if the actual MR of a pair violates its ‘apt MR’, i.e., an MR agreed on by multiple modularization tools (as raters), it can be deemed likely a flawed architectural decision that necessitates further examination. To quantify and evaluate PairSmell, we conduct an empirical study on 20 C/C++ and Java projects, using 4 established modularization tools to identify two forms of PairSmell: inapt separated pairs$InSep$and inapt collocated pairs$InCol$. Our study on 260,003 instances reveals that their architectural impacts are substantial: (1) on average, 14.60 % and 20.44 % of software entities are involved in$InSep$and$InCol$MRs respectively; (2)$InSep$pairs are associated with 190 % more co-changes than properly separated pairs, while$InCol$pairs are associated with 35% fewer co-changes than properly collocated pairs, both indicating a successful identification of modular structures detrimental to software quality; and (3) both forms of PairSmell persist across software evolution. This evidence strongly suggests that PairSmell can provide meaningful insights for inspecting modular structure, with the identified issues being both granular and fundamental, making the enhancement of modular design more efficient.
@inproceedings{paperbot8760,
title = {PairSmell: A Novel Perspective Inspecting Software Modular Structure},
author = {Chenxing Zhong and Daniel Feitosa and Paris Avgeriou and Huang Huang and Yue Li and He Zhang},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00072}
}