The phenomenon of architecture erosion can negatively impact the maintenance and evolution of software systems, and manifest in a variety of symptoms during software development. While erosion is often considered rather late, its symptoms can act as early warnings to software developers, if detected in time. In addition to static source code analysis, code reviews can be a source of detecting erosion symptoms and subsequently taking action. In this study, we investigate the erosion symptoms discussed in code reviews, as well as their trends, and the actions taken by developers. Specifically, we conducted an empirical study with the two most active Open Source Software (OSS) projects in the OpenStack community (i.e., Nova and Neutron). We manually checked 21,274 code review comments retrieved by keyword search and random selection, and identified 502 code review comments (from 472 discussion threads) that discuss erosion. Our findings show that (1) the proportion of erosion symptoms is rather low, yet notable in code reviews and the most frequently identified erosion symptoms are architectural violation, duplicate functionality, and cyclic dependency; (2) the declining trend of the identified erosion symptoms in the two OSS projects indicates that the architecture tends to stabilize over time; and (3) most code reviews that identify erosion symptoms have a positive impact on removing erosion symptoms, but a few symptoms still remain and are ignored by developers. The results suggest that (1) code review provides a practical way to reduce erosion symptoms; and (2) analyzing the trend of erosion symptoms can help get an insight about the erosion status of software systems, and subsequently avoid the potential risk of architecture erosion.
翻译:结构侵蚀现象可能会对软件系统的维护和演变产生消极影响,并表现在软件开发过程中的各种症状中。虽然侵蚀往往被认为相当晚,但其症状可以作为软件开发者的预警,如果在时间上检测到的话。除了静态源码分析外,代码审查可以成为检测侵蚀症状和随后采取行动的一个来源。在这项研究中,我们调查代码审查中讨论的侵蚀症状及其趋势,以及开发者采取的行动。具体地说,我们与OpenStack社区两个最活跃的开放源码软件(OSS)项目(即Nova和Neutron)进行了实证研究。我们人工检查了21 274项代码审查评论,通过关键词搜索和随机选择检索到的评论,并确定了502项代码审查评论(来自472个讨论线索),讨论侵蚀症状和随后采取行动。我们的调查结果显示:(1) 侵蚀症状的比例相当低,但在代码审查中仍然明显,而且最经常发现的侵蚀症状是建筑违规、功能重复和周期依赖性;(2) 在两个开放源码软件项目中查明的侵蚀症状不断下降的趋势表明,结构往往会稳定下来,但实际上的侵蚀趋势则会减少;(3) 大多数代码审查结果显示侵蚀状况。