The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Unit Test Patterns

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Keith Ray

Posts: 658
Nickname: keithray
Registered: May, 2003

Keith Ray is multi-platform software developer and Team Leader
Unit Test Patterns Posted: Apr 11, 2005 4:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Keith Ray.
Original Post: Unit Test Patterns
Feed Title: MemoRanda
Feed URL: http://homepage.mac.com/1/homepage404ErrorPage.html
Feed Description: Keith Ray's notes to be remembered on agile software development, project management, oo programming, and other topics.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Keith Ray
Latest Posts From MemoRanda

Advertisement

Gerard Meszaros seeks feedback here: http://tap.testautomationpatterns.com:8080/index.html:

Much of the material on this site is destined for a book to be published by Pearson Education (Addison Wesley). Feel free to comment on the Book Outline or to volunteer to be a reviewer (whether official or otherwise.)

Quoting Using Test Doubles:

Note to reviewers: A key purpose of publishing these patterns is to give everyone a common vocabulary for talking about test design. Current usage of terms such as Mock Object, Stub, Fake and Dummy Object are used in many different ways with the meaning of each term becoming very ambiguous. I have tried to standardize on the most common or most correct (as defined in related literature) usage. I invented the name Test Double as the generic name for Dummies, Stubs, Fakes and Mock Objects. Feedback on this proposal for standardized terminology is earnestly requested!

Types of Test Doubles

A Test Double is any object or component that we install in place of the real component specifically so that we can run a test. Depending on the reason for why we are using it, it can behave in one of four basic ways:

A Dummy Object is a placeholder object that is passed to the SUT as a parameter but is never actually used.

A Test Stub is an object that is used by a test to replace a real component on which the SUT depends so that the test can control the indirect inputs of the SUT. This allows the test to force the SUT down paths it might not otherwise exercise. A more capable version of a Test Stub, the Recording Test Stub can be used to verify the indirect outputs of the SUT by giving the test a way to inspect them after exercising the SUT.

A Mock Object is an object that is used by a test to replace a real component on which the SUT depends so that the test can verify its indirect outputs. Typically, the Mock Object fakes the implementation by either returning hard-coded results or results that were pre-loaded by the test.

A Fake Object (or just "Fake" for short) is an object that replaces the functionality of the real depended-on component with an alternate implementation of the same functionality.

Check out the nice diagram on that page, which includes "Eager Mock Object", "Lazy Mock Object", and "Recording Test Stub", as well as the other types of dummy objects mentioned above.

Read: Unit Test Patterns

Topic: A shot to the gut Previous Topic   Next Topic Topic: In case I'd forgotten

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use