The Case For Typemock

I just wrote an email to someone regarding Typemock. We were discussing why they don't think Typemock holds the values that other mocking frameworks hold when I suddenly realized what I've been wanting to say all along about Typemock, and why it's a viable option for organizations (disclosure - I recently started working at Typemock)

Before you read what I wrote, you can read posts that say "don't use Typemock" here, here,here and there are others. Most fear that Typemock will make it easy for you to write non testable code, or that your design will suffer for it. You can read my thoughts on this here and here.

The following is in argument of people saying that Typemock contradicts the agile values of TDD and unit testing by supplying workarounds for common testability problems.

The trick is to look at the bigger picture. sometimes you are looking at details so up close that you lose site of the whole idea behind mocking frameworks to begin with. Making the team more agile.

 

Easier to digest

Typemock is to Rhino.Mocks as Scrum is to eXtreme Programming- one is much easier(less scary) to swallow to the uninitiated than the other,  but they eventually lead to the same overall result - a team that can do a better job with better feedback.

It is a business oriented mocking framework. It speaks in a language that managers who don't feel "agile" can understand. It will help them write tests for existing code, it will help them write tests more easily on new code as well. It will be a bigger ROI than the other frameworks because of these benefits.

That, in turn, means that Typemock is easier to adopt in non agile\unit testing organizations, but it still plants that agile seed in there. The developer that today uses it to write tests against their legacy code, will write unit tests with it tomorrow on greenfield code. it  is their choice when to use it, but at least now they have a tool that was "insertable" into the organization which can now be used for more and more agility in the dev team.

A bridge between Agile and Non Agile

Typemock is a "bridge" between the pure, extreme, agile world and the business oriented, manager facing, legacy ridden, agile fearing world that we all love to whine about so much. Because it tries to speak to that world, and to those managers who don't want to give up their existing OO beliefs (designing for testability?), it also feels controversial to the pure agile world.

it is neither here nor there. not pure Agile\Testability but also allows agility through unit testing if you use it right. That means it's also in both worlds - it connects the business and agile world by making writing tests simpler, and the trouble of learning the techniques is easier to explain.

Typemock can help drive change where others can't

Typemock can drive change in non agile organizations sometimes more than other frameworks such as RhinoMocks or NMock, simply because it will cater to needs (such as legacy code, non testable code) that the other frameworks do not make possible. That is what makes it unique, and what makes it so different that the agile world doesn't quite know how to swallow it.

Don't be dogmatic

And if you really feel that you wouldn't recommend Typemock because it doesn't subscribe to the way you think things should be done, aren't you being a little dogmatic? agile is about embracing what works for a particular team and Typemock certainly does solve lots of problems for real teams. Just because they don't use concepts we're used to as often, doesn't mean they aren't becoming more and more agile every day.

 

Update: I posted a 10 minute intro video to Typemock here.

Published Sunday, January 20, 2008 5:59 PM by RoyOsherove

Comments

Sunday, January 20, 2008 7:09 PM by Jay Flowers

# re: The Case For Typemock

I have long since changed my tune.  First let me say that I have always thought that TypeMock was a good idea for me to have I was just worried about the heathens using it. ;-)  Jeremy Miller convinced me that attitude was a problem and I now think that it is best to have the "sharpest tools" for all.

P.S. I don't like TypeMock being analogized to Scrum.  I fail to see how that takes you to a good place.

Sunday, January 20, 2008 7:19 PM by Jeremy D. Miller

# re: The Case For Typemock

Lots of big claims Roy, but not much in the way of facts or examples.  Can we take the conversation off another way?  I, and a whole bunch of others, feel like the whole "I can mock anything, anytime, anywhere" thing is either harmful or not really that important in the greater scheme of things (my stance btw).  You might be walking uphill trying to argue the Type interception aspect of TypeMock as a deciding factor.  

That being said, what other reasons might I choose TypeMock over RhinoMocks?  RhinoMocks is free, and there's a huge amount of literature, community, and blogging examples of its usage.  I've seriously never seen an example of TypeMock usage on a blog.  Not one single blog post.

Personally, the only thing that's going to sell me on TypeMock over (FOSS) RhinoMocks is if you can show me that the syntax is easier to read and write.

I'm not really trying to argue with you so much as see exactly why you think TypeMock has an advantage over RhinoMocks.  Sell me on the usability of TypeMock.

Monday, January 21, 2008 3:07 AM by Colin Jack

# re: The Case For Typemock

@Jeremy

You are right, the free version of TypeMock does not have the same quality of syntax as Rhino. The versions you pay for have cool features but the price per desk seems to me to be prohibitive for a mocking framework.

Monday, January 21, 2008 3:22 AM by Lucy Meade

# re: The Case For Typemock

Your blogs are just becoming a glorified advert for Typemocks.

If you are turning this into a us vs Rhino then remember that Rhino mocks beats you on the 2 major factors  - it comes at an attractive price and has great community support.

Monday, January 21, 2008 4:28 AM by Casey

# re: The Case For Typemock

Jeremy, I blogged one example of using it ... which wasn't good, and Eli corrected it to a much better syntax (blog.goinsane.co.uk/CommentView,guid,090dc64c-396c-4d68-8741-853b4c0ceb52.aspx)  ... functionaly in my case it was roughly the same as Rhino Mocks, but had the advantage of being able to mock SharePoint in my case.

I mentioned the excellent community support for Rhino, and certainly convincing a client to shell out for TYpeMock on every desk would be an uphill struggle if they haven't already started pushing beyond the capabilities of Rhino Mocks ...

So I would certainly be interested in knowing the things it brings me beyond the other options in the market, mocking the unmockable is a big benefit for certain legacy systems ... but what else does it bring me the rest of the time?

I'm hoping that Roy going to TypeMock will bring some of his excellent testing examples to the TypeMock world, and increase visibility beyond the sales pitch on the site.

Monday, January 21, 2008 5:28 AM by Steve Freeman

# re: The Case For Typemock

I do hope that Roy represents the new voice of TypeMock, this is a more reasonable position than we've seen in the past; TypeMock has been as dogmatic as any of us in this storm in a teacup. As I've said to Roy elsewhere, my issue (in case anyone cares) is not the tool but the position the authors have historically taken.

Personally, I'd like to feel that the people at TypeMock understand the trade-offs in their position, and that they're doing their bit to lead people on to the "good stuff". TypeMock has powerful features that can make a team more Agile--or help them paint themselves into a corner and give up in disgust.

I've been on a couple of gigs where I had to clean up complicated, brittle tests that were just dragging the team down. One of the worst problems was endless multi-level mocking to get around the fact that they weren't breaking up the code. The ability to override classes meant that they hadn't been thinking about object roles and responsibilities, just slicing through the code to get through this ****ing test. Often they'd have been better off writing integration tests instead. (I've also seen  some pretty unproductive Scrum adoptions too, so maybe the metaphor applies after all :-)

Monday, January 21, 2008 5:42 AM by RoyOsherove

# re: The Case For Typemock

Lucy :

I'm writing my thoughts and concerns about what I do on my blog. I just so happen to be inside a testing tool that is quite contravercial for many people, which leads me to many thoughts which sometimes challenge assumptions.

Since unit testing is what I do, and I work on a unit testing tool, it is natural that i open up the state for conversation about what the pros and cons are for such a thing, and what it means for our industry.

I'm trying to stay fair and balanced by bringing in opposing views to what you call "adverts" inside the posts, there by creating a real discussion.

for what it's worth, I'd probably take the time to write the same things if I wasn't starting to work there, and was working full time with it.

Guess what? I'll also be using this blog to post help videos on Typemock, so people can learn its strength and basic usage. If someone else did that, would it be adverts, or just help to the community? Does it matter as long as someone learns something?

# Video: Typemock Basics - Lesson 1 (Dependency breaking 101) - ISerializable - Roy Osherove's Blog

Pingback from  Video: Typemock Basics - Lesson 1 (Dependency breaking 101) - ISerializable - Roy Osherove's Blog

Monday, January 21, 2008 8:23 AM by Colin Jack

# re: The Case For Typemock

@Casey

"mocking the unmockable is a big benefit for certain legacy systems"

True but equally mocking something when I feel the current design is more than adequate is also a case.

Monday, January 21, 2008 4:26 PM by naraga

# re: The Case For Typemock

at the beginning - during my evaluation of typemock - i was excited about the same things. i was sure that this tool finally teaches lazy coders to write unit tests. but i dont think that way anymore. you have to explain to people why unit testing matters and be sure they understood. there is no way to avoid unit testing consciously once you know what you are  getting.  typemock is nice but its definitelly not worth its price comparing with alternatives. i would buy it for 50 bucks because of few of its nifty features but not for the price that it is offered now. sorry

Tuesday, January 22, 2008 8:04 AM by Sam Gentile

# New and Notable 218

Ok, lets see if I can get in a groove for a few days Agile/Software Development When James Shore worked

Tuesday, January 22, 2008 10:23 AM by Jay Kimble

# Wow! Someone gets it!

[This post is in response to a post (actually a couple posts) that Roy Osherove has recently posted on

# Eli Lopian’s Blog (TypeMock) » Blog Archive » Typemock and Design Issues

Pingback from  Eli Lopian’s Blog (TypeMock)  » Blog Archive   » Typemock and Design Issues

Tuesday, December 02, 2008 6:45 PM by Sam Gentile's Blog

# New and Notable 218

Ok, lets see if I can get in a groove for a few days Agile/Software Development When James Shore worked with my Agile team , he heavily used the concept of Etudes to improve technical skills . It worked extremely well in helping our team learn about our