What considerations should be made when deciding between using a mock and a stub in a test case?

  • The complexity of the test scenario
  • The need for recording method calls
  • The desire to control method behavior
  • The size of the test data
When deciding between using a mock and a stub in a test case, considerations should include the complexity of the test scenario, as mocks are generally more complex than stubs. Recording method calls is a characteristic of mocks, and controlling method behavior is a characteristic of stubs. The size of the test data is typically not directly related to choosing between mocks and stubs.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *