Skip to main content
QUICK REVIEW

[论文解读] Does chronology matter in JIT defect prediction? A Partial Replication Study

Hadi Jahanshahi, Dhanya Jothimani|arXiv (Cornell University)|Mar 5, 2021
Software Engineering Research参考文献 27被引用 5
一句话总结

本研究探讨了代码变更数据的时间顺序是否影响即时缺陷预测(JIT)模型。基于四个开源项目(Eclipse JDT、Mozilla、Eclipse Platform 和 PostgreSQL)的五类代码变更属性(大小、传播范围、历史、经验、目的)及随机森林模型,研究发现模型的预测能力随时间保持稳定,但属性重要性存在波动。关键贡献在于提出一种加权采样方法,通过优先考虑近期数据提升模型校准性,从而在不牺牲历史数据广度的前提下增强模型性能。

ABSTRACT

Just-In-Time (JIT) models detect the fix-inducing changes (or defect-inducing changes). These models are designed based on the assumption that past code change properties are similar to future ones. However, as the system evolves, the expertise of developers and/or the complexity of the system also changes. In this work, we aim to investigate the effect of code change properties on JIT models over time. We also study the impact of using recent data as well as all available data on the performance of JIT models. Further, we analyze the effect of weighted sampling on the performance of fix-inducing properties of JIT models. For this purpose, we used datasets from Eclipse JDT, Mozilla, Eclipse Platform, and PostgreSQL. We used five families of change-code properties such as size, diffusion, history, experience, and purpose. We used Random Forest to train and test the JIT model and Brier Score and the area under the ROC curve for performance measurement. Our paper suggests that the predictive power of JIT models does not change over time. Furthermore, we observed that the chronology of data in JIT defect prediction models can be discarded by considering all the available data. On the other hand, the importance score of families of code change properties is found to oscillate over time. To mitigate the impact of the evolution of code change properties, it is recommended to use a weighted sampling approach in which more emphasis is placed upon the changes occurring closer to the current time. Moreover, since properties such as "Expertise of the Developer" and "Size" evolve with time, the models obtained from old data may exhibit different characteristics compared to those employing the newer dataset. Hence, practitioners should constantly retrain JIT models to include fresh data.

研究动机与目标

  • 通过部分复制方法验证并扩展 McIntosh 和 Kamei(2020)关于 JIT 缺陷预测的研究发现。
  • 探究随着软件系统演化,JIT 模型的预测能力是否会随时间退化。
  • 分析代码变更属性(如大小、开发者经验)的重要性如何随时间与系统老化而演变。
  • 评估使用全部历史数据与仅使用近期数据对模型性能的影响。
  • 提出并评估一种加权采样策略,通过优先考虑近期变更来提升模型校准性与判别能力。

提出的方法

  • 使用四个开源项目(Eclipse JDT、Mozilla、Eclipse Platform 和 PostgreSQL)的数据复制原始 JIT 缺陷预测研究。
  • 从版本控制和缺陷跟踪数据中提取五类代码变更属性:大小、传播范围、历史、经验与目的。
  • 使用 Brier Score(BS)和 Area Under Curve(AUC)作为性能指标,训练并评估随机森林模型。
  • 应用 Wilcoxon Signed Rank Test 对比使用全部可用数据与仅使用近期数据子集的模型性能。
  • 提出并评估一种加权采样策略,为更近期的变更分配更高权重,以反映代码属性的演化。
  • 使用 SZZ 算法识别引发修复的变更,同时谨慎对待其在提交-缺陷映射中的已知局限性。

实验结果

研究问题

  • RQ1RQ1:随着软件系统演化,JIT 模型的预测能力是否会随时间退化?
  • RQ2RQ2:代码变更属性与引发修复可能性之间的关系是否会随时间演变?
  • RQ3RQ3:通过加权采样策略考虑数据的时间顺序,能否提升 JIT 模型的性能?

主要发现

  • JIT 模型的预测能力随时间保持稳定,表明使用历史数据训练的模型在时间推移中不会显著损失准确性。
  • 代码变更属性族(如大小、经验)的重要性评分随时间波动,表明某些特征的相关性随系统老化而演变。
  • 仅使用近期数据(如最近六个月)可实现比使用全部历史数据更好的模型校准性与判别能力,尽管 AUC 分数相似。
  • 所提出的加权采样方法通过强调近期变更,同时保留大规模训练数据的优势,提升了 Brier Score(BS),表明模型校准性更好。
  • 使用全部可用数据训练的模型可能因过时的属性相关性而错误反映当前的特征依赖关系,尤其对于开发者经验、代码大小等动态属性。
  • 结果表明,实践者应定期使用近期数据重新训练 JIT 模型,以保持与当前开发模式和属性动态的一致性。

更好的研究,从现在开始

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

无需绑定信用卡

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