QA Fundamentals · Middle · Question 21 of 75

How does a test double such as a mock or stub help?

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.

Further reading

Problem with a question

QA Fundamentals · Middle · question 21

Test yourself

Take the QA Fundamentals · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz