- 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
-
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 ...
-
In this post we will see how to do an offline install Jenkins and required plugins on a Red Hat Enterprise Linux Server release 7.3. This is...
-
Update: A new post for validation in struts with annotation is available at: Struts 2 Validation: Annotations . Struts 2.0 relies on a val...
-
The previous post described the Strategy pattern in brief. I listed out where and why the strategy pattern may be used. This post describes...
-
Google has opensourced it's Google Web Toolkit . The project is now fully opensource under the Apache 2.0 license . The new 1.3 RC has...
-
Previously, I wrote a post describing the use of Apache Axis to create and consume Web Services from Java . In this post, I will describe ho...
-
Big Faceless Report Generator is a commercial Java API for generating PDF files from XML input . The report generator is built on the Big F...
-
iText is a Java API for reading, writing, and editing PDF documents and PDF forms. The latest release (v1.4.7) adds support for AES encrypti...
-
The Observer pattern allows an object (an Observer) to watch another object (a Subject). The subject and observer to have a publish/subscrib...
-
Just moved to blogger beta. Testing the changes.
No comments:
Post a Comment