- Stub: Programmed (by the test automater) to respond to calls made during the test (and only the calls used for the test). Test Stub returns pre-defined values (inputs, with expected outputs). Used to test indirect inputs.
- Mock Object: Represent test doubles used to test the outputs (in an indirect way). A mock object is designed to expect certain calls from the system under test, failing which the mock object throws an exception (thus failing the test). In other words, mocks are used as indirect way to test the outputs of the system under test.
- Dummy Parameter: A dummy (or placeholder) is used to fill parameter lists and are not used anywhere else.
- Fake Object: Fake objects provide the same functionality as the real object, but uses "shortcuts" to obtain the results. Fake objects are only used to speed up testing and avoid probable side-effects.
Friday, April 28, 2006
Fake Dummy Mocks Stubs
Gerard Meszaros has come up with a new name for the mocks, fakes etc. - objects that are used in the place of actual objects while testing. In his soon to come book titled XUnit Test Patterns, he proposes a new name - Test Doubles for all these objects. While Test Double covers the general set of objects used to represent a real time object during testing, there are four different types of Test Doubles vis-a-vis:
Labels:
patterns
Subscribe to:
Post Comments (Atom)
Popular Posts
-
In a previous post, I described how to use Quartz scheduler for scheduling . In this post, I describe the configuration changes required for...
-
JUnit 4 introduces a completely different API to the older versions. JUnit 4 uses Java 5 annotations to describe tests instead of using in...
-
The JDBC abstraction layer of Spring framework offers an understandable exception hierarchy, simplifies error handling, and greatly reduces ...
-
This post will describe how to create and deploy a Java Web Application war to Heroku using Heroku CLI. You will need a basic understanding ...
-
Last week, I described how to implement JMS, using a stand-alone client and a Message Driven Bean . In this post and the next, I will descr...
-
This is an example code for a simple PDF merge using iText 5. We use three InputStream s in a List as input and merged file is written to th...
-
The previous post described how to implement a JMS messaging client using Spring JMS . This post will describe how to implement the Message ...
-
Update: A new post for validation in struts with annotation is available at: Struts 2 Validation: Annotations . Struts 2.0 relies on a val...
-
New posts with iText 5.5.12 Following are two new posts for PDF Merge with iText 5.5.12 Merge PDF files using iText 5 Merge and Paginate PDF...
-
In this post we will see a way to merge multiple PDF files while adding page numbers at the bottom of each page in the format Page 1 of 10 ....
No comments:
Post a Comment