Skip to Content
Effective Unit Testing
book

Effective Unit Testing

by Lasse Koskela
February 2013
Intermediate to advanced content levelIntermediate to advanced
258 pages
7h 26m
English
Manning Publications
Content preview from Effective Unit Testing

2.6. Every trade has its tools and tests are no exception

What’s this test double I speak of? If you don’t have test doubles in your programmer’s toolkit, you’re missing out on a lot of testing power. Test double is an umbrella term for what some programmers have come to know as stubs, fakes, or mocks (which is short for mock object). Essentially they’re objects that you substitute for the real implementation for testing purposes. See figure 2.4.

Figure 2.4. A test double for a duck looks just like a duck and quacks almost like a duck—but certainly isn’t a real duck.

You could say that test doubles are a test-infected programmer’s best friend. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Art of Unit Testing, Second Edition

The Art of Unit Testing, Second Edition

Roy Osherove
Testing with JUnit

Testing with JUnit

Leonard Przybylski, Frank Appel

Publisher Resources

ISBN: 9781935182573Publisher SupportOtherPublisher WebsiteErrata PageSupplemental ContentPurchase Link