一句话:分析数百个 GitHub 项目后发现,缺陷集中在项目早期,前150次提交和四个月数据训练的缺陷预测器已足够好。
本文质疑软件分析中“数据越多越好”的常见假设,并以软件缺陷预测为切入点研究早期生命周期数据是否足够。作者分析了数百个流行 GitHub 项目,这些项目运行时间中位数为84个月、提交数中位数为3,728次。观察发现,大多数缺陷发生在项目生命周期很早的阶段。因此,仅使用前150次提交和四个月数据学习得到的缺陷预测器,其性能与使用更多数据或后续数据的方法相当。这意味着至少在这些项目上,项目开始几个月后无需持续更新缺陷预测模型。作者据此倡导“简单优先”的分析方法,建议在假设问题复杂且需要大量数据之前,先检查原始数据中可能存在的简化捷径。
Many researchers assume that, for software analytics, "more data is better." We write to show that, at least for learning defect predictors, this may not be true. To demonstrate this, we analyzed hundreds of popular GitHub projects. These projects ran for 84 months and contained 3,728 commits (median values). Across these projects, most of the defects occur very early in their life cycle. Hence, defect predictors learned from the first 150 commits and four months perform just as well as anything else. This means that, at least for the projects studied here, after the first few months, we need not continually update our defect prediction models. We hope these results inspire other researchers to adopt a "simplicity-first" approach to their work. Some domains require a complex and data-hungry analysis. But before assuming complexity, it is prudent to check the raw data looking for "short cuts" that can simplify the analysis.