It can return prepared responses, record calls or simulate selected conditions in place of a service or dependency. This helps isolate the part of a system being examined.
The substitute covers only the behavior it models. Tests using it need to be complemented by appropriate checks that the real integration behaves as expected.
ELI5
Think of using a stand-in during a rehearsal so one part of a performance can be practiced in a controlled way.
For example, a test can replace a remote tool with a prepared response to reproduce the exact condition that caused an agent to fail.
Is every test double a mock?
No. Mock is one commonly used kind or label, while test doubles can serve several different substitution roles.
Does passing a test with a substitute prove the live service works?
No. The real service and interface still need suitable integration verification.



