Search papers, labs, and topics across Lattice.
This paper introduces MIRAGE, a novel online microservice dependency simulation approach that uses LLMs to directly answer dependency requests at runtime, maintaining cross-request state. MIRAGE reads dependency source code, caller code, and production traces to simulate dependency behavior on demand, eliminating the need for pre-generated mock specifications. Experiments on three microservice systems demonstrate that MIRAGE achieves significantly higher status-code and response-shape fidelity compared to record-replay, while also accurately replicating end-to-end integration test outcomes.
Forget brittle mocks: MIRAGE uses LLMs to simulate microservice dependencies on-the-fly, achieving 99% fidelity without pre-generated specifications.
Existing approaches to microservice dependency simulation--record-replay, pattern-mining, and specification-driven stubs--generate static artifacts before test execution. We propose online LLM simulation, a runtime approach where the LLM directly answers each dependency request as it arrives, maintaining cross-request state throughout a test scenario. No mock specification is pre-generated; the model reads the dependency's source code, caller code, and production traces, then simulates dependency behavior on demand. We instantiate this approach in MIRAGE and evaluate it on 110 test scenarios spanning 14 caller-dependency pairs across three microservice systems (Google's Online Boutique, Weaveworks'Sock Shop, and a custom system). In white-box mode (dependency source available), MIRAGE achieves 99% status-code fidelity (109/110) and 99% response-shape fidelity, compared to 62% / 16% for record-replay. End-to-end, caller integration tests produce the same pass/fail outcomes with MIRAGE as with real dependencies (8/8 scenarios). A signal ablation shows dependency source code is often sufficient for high-fidelity runtime simulation (100% alone); without it, the model still infers correct error codes (94%) but loses response-structure accuracy (75%). Constraining LLM output through typed intermediate representations reduces fidelity on complex stateful services (55%) while performing adequately on simple APIs (86%), suggesting that the runtime approach's implicit state tracking matters for behavioral complexity. Results are stable across three LLM families (within 3%) at $0.16 to $0.82 per dependency.