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?
✗ Incorrect
A stub returns predefined responses but does not track how it was called.
What extra feature does a mock have compared to a stub?
✗ Incorrect
Mocks record how they are used and allow verification of interactions.
In Postman, what is the main use of a mock server?
✗ Incorrect
Postman mock servers simulate API responses for testing without needing the real API.
When should you prefer a stub over a mock?
✗ Incorrect
Stubs are used when only fixed responses are needed, without verifying interactions.
Which statement is true about mocks and stubs?
✗ Incorrect
Mocks can verify interactions, while stubs only provide fixed responses.
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.