Mock

A stand-in for a real dependency that a test controls and inspects.

Think of it as A cardboard bank vault on your desk that answers instantly and writes down every request.

Mocks replace slow or unreliable things such as DataStores, HTTP calls and time. They only fail when the test tells them to, so good suites include mocks that throw. Code can only be mocked if it receives its dependencies instead of fetching them itself.

Where the picture breaks

The vault keeps only the last write for a key, so two servers writing the same key can silently undo each other.

A DataStore is a remote key-value store with request budgets. Calls are slow and can throw, so code wraps them, retries carefully and uses UpdateAsync or a session lock when more than one server might write.

See it with the rest of the analogy cast

Official reference: roblox.github.io

Related terms