QA Fundamentals · Middle · Question 21 of 75
How does a test double such as a mock or stub help?
- 1It doubles the test data so load testing is easier
- 2It replaces a real dependency so a test is fast and controlled
- 3It runs every test twice to check that results match
Show the answer
Correct answer: It replaces a real dependency so a test is fast and controlled
Explanation
Replacing a payment gateway or email service with a double lets you test error paths (timeouts, declines) that are hard to trigger for real.