代码评审中的架构侵蚀症状:两个OpenStack项目的研究
Symptoms of Architecture Erosion in Code Reviews: A Study of Two OpenStack Projects
摘要:
体系结构侵蚀现象会对软件系统的维护和演化产生负面影响,并在软件开发过程中表现为各种症状。虽然侵蚀通常被认为是相当晚的,但如果及时发现,它的症状可以作为软件开发人员的早期警告。除了静态源代码分析之外,代码审查也可以作为检测侵蚀症状并随后采取措施的来源。在这项研究中,我们调查了代码审查中讨论的侵蚀症状,以及它们的趋势,以及开发人员采取的行动。具体来说,我们对OpenStack社区中两个最活跃的开源软件(OSS)项目进行了实证研究(即,中子(Neutron)。我们手动检查了通过关键字搜索和随机选择检索到的21,274条代码审查评论,并确定了502条代码审查评论(来自472个讨论线程)讨论侵蚀。我们的研究结果表明:(1)侵蚀症状的比例很低,但在代码审查中很明显,最常见的侵蚀症状是架构违规、重复功能和循环依赖;(2)在两个OSS项目中,侵蚀症状的下降趋势表明架构随着时间的推移趋于稳定;以及(3)大多数识别侵蚀症状的代码审查对消除侵蚀症状具有积极影响,但一些症状仍然存在并被开发人员忽视。研究结果表明:(1)代码评审为减少腐蚀症状提供了一种切实可行的方法;(2)分析腐蚀症状的趋势有助于了解软件系统的腐蚀状况,从而避免潜在的体系结构腐蚀风险。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。