Skip to main content
QUICK REVIEW

[论文解读] Code Red: The Business Impact of Code Quality -- A Quantitative Study of 39 Proprietary Production Codebases

Adam Tornhill, Markus Borg|arXiv (Cornell University)|Mar 8, 2022
Software Engineering Research被引用 4
一句话总结

本项定量研究通过代码健康度指标、版本控制数据和Jira问题追踪系统,分析了39个专有生产代码库,证明低代码质量会显著增加缺陷率、开发时间及不可预测性。研究发现,低质量代码的缺陷数量是高质量代码的15倍,修复时间平均延长124%,最大周期时间延长9倍,表明代码质量是关键业务因素,而不仅仅是技术问题。

ABSTRACT

Code quality remains an abstract concept that fails to get traction at the business level. Consequently, software companies keep trading code quality for time-to-market and new features. The resulting technical debt is estimated to waste up to 42% of developers' time. At the same time, there is a global shortage of software developers, meaning that developer productivity is key to software businesses. Our overall mission is to make code quality a business concern, not just a technical aspect. Our first goal is to understand how code quality impacts 1) the number of reported defects, 2) the time to resolve issues, and 3) the predictability of resolving issues on time. We analyze 39 proprietary production codebases from a variety of domains using the CodeScene tool based on a combination of source code analysis, version-control mining, and issue information from Jira. By analyzing activity in 30,737 files, we find that low quality code contains 15 times more defects than high quality code. Furthermore, resolving issues in low quality code takes on average 124% more time in development. Finally, we report that issue resolutions in low quality code involve higher uncertainty manifested as 9 times longer maximum cycle times. This study provides evidence that code quality cannot be dismissed as a technical concern. With 15 times fewer defects, twice the development speed, and substantially more predictable issue resolution times, the business advantage of high quality code should be unmistakably clear.

研究动机与目标

  • 量化代码质量对缺陷率、开发时间及问题修复可预测性的影响。
  • 解决业务管理者难以理解的代码质量度量指标缺失问题。
  • 证明技术债务和低代码质量会浪费大量开发人员时间并降低团队生产力。
  • 提供实证证据,表明高代码质量可提升开发速度、减少缺陷并提高进度可预测性。
  • 倡导将代码质量视为根本性业务目标,而不仅仅是技术问题。

提出的方法

  • 本研究采用CodeScene的代码健康度指标作为代码质量的代理指标,将文件划分为健康(Healthy)、警告(Warning)和红色(Red,警报)三个等级。
  • 结合源代码分析、版本控制数据挖掘和Jira问题数据,计算文件级别的开发周期时间。
  • 研究人员分析了来自不同领域的39个专有生产代码库中的30,737个文件。
  • 计算不同代码质量等级下的缺陷密度、平均和最大周期时间,以及开发时间的方差。
  • 通过统计分析比较不同代码健康等级下的开发工作量和可预测性。
  • 该方法可实现对开发时间与问题修复模式的细粒度、文件级追踪。

实验结果

研究问题

  • RQ1代码质量如何影响生产代码中报告的缺陷数量?
  • RQ2代码质量如何影响修复问题所需的平均时间?
  • RQ3代码质量在多大程度上影响问题修复的可预测性,以周期时间方差衡量?
  • RQ4代码质量如何影响问题修复的最大周期时间?
  • RQ5代码质量与开发工作量不确定性之间存在何种关系?

主要发现

  • 低质量代码(红色代码健康度)的缺陷数量是高质量代码(健康代码)的15倍。
  • 在低质量代码中修复问题的平均时间比在高质量代码中长124%。
  • 低质量代码中问题修复的最大周期时间是高质量代码的9倍。
  • 低质量代码的变更开发时间方差显著更高,表明其不可预测性更强。
  • 即使是处于警告级别的代码,其开发时间也比健康代码长78%,表明中等质量问题已产生显著的业务影响。
  • 低质量代码开发时间的高方差增加了团队压力,降低了计划准确性,影响团队绩效与可持续性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。