Skip to content
Author: Tianle Yuan




Mock means "fake". The point of using mock is for parallelize development. When we want to test the frontend, if the backend is still in development, we can use a mock server or mock data for temporal use.

When use mock?
  1. Testing (unit test, integration test).
  2. Parallelize work (frontend and backend).
  3. Develop without the payment 💰💰💰 for real server responses and requests.

Mock Server⚓︎

Mock Server

Definition: imitate a real server by providing realistic mock responses to requests.


  • Same abstract interface/contract (e.g. REST API).
  • Not a real implementation.

Mock Object⚓︎

Mock Object

Definition: in OOP (object-oriented programming), mock object is a simulated object that mimics the behavior of real objects in controlled ways (e.g. Mock class, Mock struct).

Last update: February 27, 2023 00:42:01
Created: December 5, 2022 19:54:10