Daily iOS
Testing

Test doubles

What is a test double?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

A test double is the umbrella term for a stand-in object that replaces a real dependency that's slow or unpredictable, such as the network, a database, or the clock. The dependency has to be abstracted behind a protocol and injected before you can swap the real implementation out.

Share a question