Author:
Mock⚓︎
Mock⚓︎
Mock?
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?
- Testing (unit test, integration test).
- Parallelize work (frontend and backend).
- 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.
Properties:
- 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).