[论文解读] Cast: Automated Resilience Testing for Production Cloud Service Systems
Cast 提供一个自动化的端到端框架,用于通过回放生产流量并结合全面的应用级故障库、由复杂性驱动的测试选择策略以及自动化的多维验证,进行生产微服务系统的弹性测试。
The distributed nature of microservice architecture introduces significant resilience challenges. Traditional testing methods, limited by extensive manual effort and oversimplified test environments, fail to capture production system complexity. To address these limitations, we present Cast, an automated, end-to-end framework for microservice resilience testing in production. It achieves high test fidelity by replaying production traffic against a comprehensive library of application-level faults to exercise internal error-handling logic. To manage the combinatorial test space, Cast employs a complexity-driven strategy to systematically prune redundant tests and prioritize high-value tests targeting the most critical service execution paths. Cast automates the testing lifecycle through a three-phase pipeline (i.e., startup, fault injection, and recovery) and uses a multi-faceted oracle to automatically verify system resilience against nuanced criteria. Deployed in Huawei Cloud for over eight months, Cast has been adopted by many service teams to proactively address resilience vulnerabilities. Our analysis on four large-scale applications with millions of traces reveals 137 potential vulnerabilities, with 89 confirmed by developers. To further quantify its performance, Cast is evaluated on a benchmark set of 48 reproduced bugs, achieving a high coverage of 90%. The results show that Cast is a practical and effective solution for systematically improving the reliability of industrial microservice systems.
研究动机与目标
- 由于复杂、非确定性故障的存在,动机在于在生产级微服务系统中需要弹性测试。
- 开发一个端到端框架,通过对真实流量进行回放并引入现实的应用级故障来实现高保真。
- 通过复杂性驱动的测试选择策略来裁剪冗余测试以解决可扩展性问题。
- 使用三阶段管线和多维验证准则来自动化测试生命周期。
- 通过华为云的大规模部署与受控基准评估来展示实际有效性。
提出的方法
- 使用动态 instrumentation 捕获并回放生产流量,创建带参数化动态变量的可回放痕迹。
- 应用两阶段启发式方法从请求/响应有效负载中识别状态相关变量,并用占位符替换以实现回放。
- 使用 Drain 聚合痕迹,识别不同接口并计算每个接口的复杂度分数以实现有针对性的测试选择。
- 构建可扩展的故障库建模平台,建模组件异常和服务间通信错误,在细粒度端点处注入。
- 将端点定义为(组件、框架、方法),并利用数据流依赖模式通过跨服务抽样、跨轨迹消除和数据流优先级来裁剪测试。
- 在一个三阶段管线(启动、故障注入、恢复)中执行测试,采用快速失败策略和批量测试以最小化启动开销,并在各阶段和断言点上进行多维验证准则。
实验结果
研究问题
- RQ1RQ1:在识别动态变量后,Cast 将记录的生产流量回放的可回放性有多大?
- RQ2RQ2:Cast 在自动发现生产微服务系统中的弹性漏洞方面有多大效果?
主要发现
- 在动态变量模板化后,Cast 能回放 286 条接口痕迹中的 291 条中的大部分,实现 98.3% 的回放成功率,显著高于朴素回放的 <80%。
- 动态变量识别方法在多数接口上有效处理状态依赖,存在 5 个需要手动变量注册的边缘情况。
- 在华为云的八个月部署中,Cast 在四个大规模应用中发现 137 个潜在漏洞,开发人员确认了其中的 89 个。
- 在对 48 个再现缺陷的受控基准测试中,Cast 实现了 90% 的检测覆盖率。
- Cast 展示了在工业微服务环境中系统性提升可靠性的实际有效性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。