• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Test doubles == mock objects

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
In TDD jargon, does "test doubles" refer to mock objects?
Thanks.
 
Eric Nielsen
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic