arXiv:2607.06766cs.SEcs.LG2026-07中稿 · ASE 2026 - Industr…

用代码变更特征评估部署风险,避免全量冻结,提升发布效率。

Deployment Risk Assessment Using Diff-Aware Features: A Case Study at Prime Video

论文配图:Deployment Risk Assessment Using Diff-Aware Features: A Case Study at Prime Video
图 1 · 摘自论文原文
  • 基于代码修改内容提取特征,不依赖开发者隐私数据。
  • 在两个数据集上实现0.83召回率和0.81 F1值,准确识别高风险变更。
  • 适合需要频繁发布且关注运维安全的工程团队使用。

在亚马逊Prime Video,我们面临在大型活动和快速功能发布期间管理代码部署的运营挑战,避免服务中断。现有变更控制方法采用全量部署冻结,无论风险高低一律禁止变更,造成开发人员负担过重。尽管已有研究探索了风险变更的预测因子,但多依赖开发者特定元数据或大量历史数据,引发隐私担忧,并限制了在新项目中的应用。本文提出一种以差分感知特征为核心的框架,这些特征直接从代码修改中提取。核心贡献在于系统性识别出对风险预测必要的量化指标(代码级与变更级指标)及定性信号(编码风格违规、变更类型分类)。我们利用大语言模型作为多语言特征提取器,证明其在代码分析中的有效性,无需针对每种语言配置专用工具。在两个数据集上进行了评估:Prime Video生产环境与公开的ApacheJIT数据集。最佳模型在两个数据集上平均召回率达0.83,F1得分为0.81,成功检测高风险代码变更。值得注意的是,消融实验显示变更规模指标(如增删行数)为噪声预测因子,而代码结构复杂度则提供更强的风险信号。结果表明,精心设计的特征选择可在不同编程语言和组织环境中实现有效的变更风险评估,同时规避隐私问题。

原文摘要 · Abstract (English)

At Amazon Prime Video, we face the critical operational challenge of managing code deployments during live events and rapid feature releases without causing service outages. Current change control approaches use blanket deployment freezes that block all changes regardless of risk, creating significant developer toil. While prior research has explored risky change predictors, these rely on developer-specific metadata or extensive historical data, raising privacy concerns and limiting applicability to new projects. We introduce a framework centered on diff-aware features, characteristics derived directly from code modifications. Our key contribution is the systematic identification of which quantitative metrics (code-level and change-level metrics) and qualitative indicators (coding style violations, change type classification) are necessary for risk prediction. We employ LLMs as multi-language feature extractors, demonstrating their effectiveness for code analysis beyond generation tasks and eliminating the need for language-specific tooling. We evaluated our framework on two datasets: Prime Video's production environment and the public ApacheJIT dataset. Our best-performing model achieves an average recall of 0.83 and F1 score of 0.81 across both datasets for detecting risky code changes. Notably, ablation analysis reveals that change-level volume metrics (e.g., lines added/deleted) are noisy predictors, while structural code complexity provides a substantially stronger risk signal. These results demonstrate that thoughtful feature curation enables effective change risk assessment across different programming languages and organizational contexts while avoiding privacy concerns.

代码分析风险评估LLM应用部署安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。