arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.13480cs.SE
收藏

破窗:探究一项有争议理论在代码质量上的适用性

Broken Windows: Exploring the Applicability of a Controversial Theory on Code Quality

Diomidis Spinellis, Panos Louridas, Maria Kechagia, Tushar Sharma

AI总结:

本研究基于大型代码语料库分析 C 质量指标与 Java 代码坏味道,验证破窗理论在软件代码演化中的适用性,发现既有代码质量会影响开发者后续提交行为。

摘要:

现有代码的质量是否与后续变更的质量相关?根据启发本研究的(颇具争议的)破窗理论,失序会设定描述性规范,并发出会进一步加剧失序的行为信号。我们基于一个大型代码语料库,考察代码历史是否确实会影响代码质量的演化。我们检查特定文件中的 C 代码质量指标和 Java 代码坏味道,并观察开发者后续提交是否延续这一路径。我们检验开发者是否会根据其所提交文件的质量来调整提交质量。结果表明,历史确实重要;开发者会根据其接触到的代码质量的某些方面而表现出不同行为;而且编程风格不一致并不一定与结构质量相关。这些发现对软件实践和研究均有意义。软件从业者可以重视当前的质量实践,因为它们会影响未来将要开发的代码。该领域的研究人员可以复制并扩展本研究,以增进对该理论及其对制品、过程和人员的实践意义的理解。

英文摘要:

Is the quality of existing code correlated with the quality of subsequent changes? According to the (controversial) broken windows theory, which inspired this study, disorder sets descriptive norms and signals behavior that further increases it. From a large code corpus, we examine whether code history does indeed affect the evolution of code quality. We examine C code quality metrics and Java code smells in specific files, and see whether subsequent commits by developers continue on that path. We check whether developers tailor the quality of their commits based on the quality of the file they commit to. Our results show that history matters, that developers behave differently depending on some aspects of the code quality they encounter, and that programming style inconsistency is not necessarily related to structural qualities. These findings have implications for both software practice and research. Software practitioners can emphasize current quality practices as these influence the code that will be developed in the future. Researchers in the field may replicate and extend the study to improve our understanding of the theory and its practical implications on artifacts, processes, and people.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑