0
0
Postmantesting~5 mins

Mock vs stub comparison in Postman - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is a stub in software testing?
A stub is a simple fake component that returns predefined responses to calls during testing. It helps isolate the part being tested by simulating dependent parts.
Click to reveal answer
beginner
What is a mock in software testing?
A mock is a fake object that not only returns predefined responses but also records how it was used, allowing verification of interactions during tests.
Click to reveal answer
intermediate
How does a mock differ from a stub?
A stub provides fixed responses without tracking usage, while a mock tracks how it was called and can verify if expected interactions happened.
Click to reveal answer
beginner
In Postman, what is the purpose of a mock server?
A Postman mock server simulates an API by returning predefined responses to requests, helping test clients without needing the real API.
Click to reveal answer
beginner
Why might you use a stub instead of a mock in testing?
You use a stub when you only need to provide simple fixed responses and don't need to check how the fake was used.
Click to reveal answer
Which of the following best describes a stub?
AA fake that records how it was called for verification
BA fake that returns fixed responses without tracking calls
CA real component used in testing
DA tool to generate test reports
What extra feature does a mock have compared to a stub?
AIt records and verifies interactions
BIt can simulate network delays
CIt generates random data
DIt runs tests automatically
In Postman, what is the main use of a mock server?
ATo store test data
BTo generate documentation
CTo simulate API responses without the real API
DTo run automated tests
When should you prefer a stub over a mock?
AWhen you need to verify method calls
BWhen testing UI components
CWhen running performance tests
DWhen you only need fixed responses without interaction checks
Which statement is true about mocks and stubs?
AMocks can verify interactions, stubs cannot
BStubs track how they are called
CMocks are simpler than stubs
DStubs are used only in Postman
Explain the difference between a mock and a stub in simple terms.
Think about whether the fake just replies or also remembers how it was used.
You got /3 concepts.
    Describe how Postman mock servers help in API testing.
    Imagine testing an app before the real API is ready.
    You got /3 concepts.