Join us on :

Stub in Unit Testing

Stub is nothing but a miniature replica of the Actual working code of a application, Stubs are used to test the application data. Stub return a value which is imitations or similar data of the application.

For example if actual application returns a list of Strings, then Stubs also returns list of Strings but only difference is Stub returns a dummy value, so in this case we cannot perform data validation.

Sometimes stub is a miniature of the Actual program, for instance, if actual application returns 10, 000 Strings, stub may return 100 String or 10 String. When user creates the miniature stubs, the stub may return 1 - 10% data of tha actual application

About Author

Article is written by Pavan (a) KarthiQ. Well, I am serving notice period in an MNC, Bangalore. I thought to enrich every person knowledge a little, I always have a feeling, when we teach something, we will learn more than what you know. Knowledge is the only thing that doubles when you spend it.

I have also created the reporter for Protractor Jasmine. Use for your projects without any hesitation

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions