计算机科学 > 软件工程
[提交于 2026年11月28日]
标题:MockMaster: How to Automock Your Friends and Services
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Modern cloud applications are built from independent components that communicate over APIs. Testing these applications is challenging because their components may be difficult to deploy, be owned by other teams, or have test-disrupting side-effects. Developers therefore turn to mocks to simulate such components. Manually written mocks are, however, brittle, costly to maintain, prone to errors, and typically cover only a small fraction of possible behaviors; relying on them confronts developers with the testing version of the infamous regular-expression adage: "I had a testing problem, so I wrote a mock. Now I have two problems." We present MockMaster, a system that automatically generates mocks for cloud APIs and service-based applications from their API specifications. MockMaster combines LLM agents with symbolic techniques, eliminating the need for developers to implement mocks by hand. MockMaster can repeatedly execute a test while varying mock behavior, including failures and edge cases. Across 10 RESTful service benchmarks comprising 65kloc, MockMaster achieves industry standard code coverage of excellent/acceptable for 9 of the 10, discovers a total of 119 distinct 500 errors, and eliminates flaky tests, all while costing less than $0.20 per service.
提交历史
来自:Mark Marron[v1] 2026年11月28日 星期六 15:05:27 UTC (92 KB)