This article is a simple explanation of mock and stub used in unit testing. What is stub? A stub is a small program routine that substitutes for a longer program. You should use a stub in order to pass to the code under test. What is mock? Mock is a method/object that simulates the behavior of a real method/object. A mock is an object that we can set expectations on, and which will verify that the