This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes Test doubles == mock objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Test doubles == mock objects" Watch "Test doubles == mock objects" New topic
Author

Test doubles == mock objects

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Hey,
In TDD jargon, does "test doubles" refer to mock objects?
Thanks.
Eric Nielsen
Ranch Hand

Joined: Dec 14, 2004
Posts: 194
Not normally... ( though I have heard a few people use them as synonyms)

Normally, to me, a Test Double is more similar to a Stub. It allows the program to compile and run. It might provide some replacement behavior (a Test Double for an Email Sending class/service might log/store the emails somewhere for review, etc). But its not a Mock Object in the sense of setting expected calls and verifying that these calls were received as part of the test.

However, this article seems to use Test Double as a superset term including Stubs, Mocks, fakes, etc):
http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Eric Nielsen:
However, this article seems to use Test Double as a superset term including Stubs, Mocks, fakes, etc):
http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html

That (the umbrella term) is the interpretation I've adopted, too.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Test doubles == mock objects
 
Similar Threads
jmock query
testing MessageContext
Why Mock Approach Testing Taken over traditional Junit Testing
junit & mock objects
Agile in a Flash: Mock Terminology