• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Effective Unit Testing: Does your book delve into Mock objects ?

 
Ranch Hand
Posts: 143
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Lasse Koskela,

Effective unit testing requires testing on objects, but sometimes these are not at hand, we instead use mock objects to mimic those, as they easier to create.

Does your book delve into Mock objects ? I mean do you speak about its usefulness, mock libraries, etc ?
 
Ranch Hand
Posts: 75
Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On this topic, I'm curious to know what Mock frameworks people use: JMock, EasyMock, Mockito, etc.

Also, are there new mocking frameworks out there that I may not be aware of? In general, I have been so happy with Mockito, that it is my default Mocking framework at this point in time, and I worry that maybe I'm missing the next great thing.

Thanks
David
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 3 is dedicated to the different types of "test doubles", including mock objects but also lower fidelity utilities like plain stubs. What I've tried to do with Chapter 3 is to focus on highlighting the benefits and motivation for using test doubles and helping the reader identify what type of a test double they might need. It's not always a mock object that fits the bill best, although mock object libraries such as Mockito can be used in different styles. For example, a lot of people use a mock object library to create stubs.

As for specific libraries, we've used JMock and Mockito for the example code listings but we don't really teach either. Again, the goal for Chapter 3 wasn't to teach any specific library but to teach the fundamental concepts that may (or may not) justify using such a library.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic