Analyst Integration Question:
Why would you ever want to create a mock object?
Answer:
Mock object are very useful to test an individual unit in your Software, in fact stud and mocks are powerful tool for creating automated unit tests. Suppose you write a program to display currency conversion rates but you don't have a URL to connect to, now if you want to test your code, you can use mock objects. In Java world, there are lot of frameworks which can create powerful mock objects for you e.g. Mockito and PowerMock.
Previous Question | Next Question |
What is loose-coupling? | What is difference between forking a process and spawning a thread? |