一句话:提出基于日志概率推理的 feature flag 依赖发现方法,在 Office 中精度超过 90%。
Feature flag 能加速开发与部署,但在 Microsoft Office 这类大型系统中会积累技术债:相互依赖的 flag 可能分散在代码各处,其未知交互容易引发严重 bug,而穷举所有组合测试不可行(Office 约有 12000 个活跃 flag)。本文提出一种自动发现 feature flag 相互依赖的方法,利用概率推理从 flag 查询日志中推断因果关系。该方法与语言无关、可扩展至大型异构代码库,并能容忍代码漂移和日志噪声。作者在 Office 真实查询日志上评估,发现跨源文件的非平凡间接依赖时精度超过 90%,还总结了重复出现的关系模式,并讨论了面向定向测试、部署速度判定、错误缓解和诊断的应用。
Feature flags are a popular method to control functionality in released code. They enable rapid development and deployment, but can also quickly accumulate technical debt. Complex interactions between feature flags can go unnoticed, especially if interdependent flags are located far apart in the code, and these unknown dependencies could become a source of serious bugs. Testing all possible combinations of feature flags is infeasible in large systems like Microsoft Office, which has about 12000 active flags. The goal of our research is to aid product teams in improving system reliability by providing an approach to automatically discover feature flag interdependencies. We use probabilistic reasoning to infer causal relationships from feature flag query logs. Our approach is language-agnostic, scales easily to large heterogeneous codebases, and is robust against noise such as code drift or imperfect log data. We evaluated our approach on real-world query logs from Microsoft Office and are able to achieve over 90% precision while recalling non-trivial indirect feature flag relationships across different source files. We also investigated re-occurring patterns of relationships and describe applications for targeted testing, determining deployment velocity, error mitigation, and diagnostics.
@inproceedings{paperbot6998,
title = {Discovering feature flag interdependencies in Microsoft office},
author = {Michael Schröder and Katja Kevic and Dan Gopstein and Brendan Murphy and Jennifer Beckmann},
booktitle = {FSE},
year = {2022},
doi = {10.1145/3540250.3558942}
}