Wednesday, April 29, 2009

Full, Recursive Mocking at Assembly Level

I raised the issue here, but seems that not getting any response:). So I am going to do it again, here.

Basically what I want is a full, recursive mocking at assembly level. The idea is that I just need to call a function that contains the name of an assembly, and everything in that assembly is mocked out in recursive fakes manner.

Let's say in one assembly (MyDoNothingAssembly) there are two classes:

  1. MySimpleClass
  2. MyDifficultClass
Instead of writing recursive fakes for the above classes twice, I just need to write
Isolate.Fake.Assembly< MyDoNothingAssembly>();
and these two classes are now fully faked!

What do you think?

Tuesday, April 28, 2009

Racer Is Coming!

In the next few weeks, we're going to release Racer!

For those who don't frequent the Product page of our site, Racer is a product that identifies problems in multi-threaded applications. The current feature set includes finding deadlocks in all kind of scenarios and APIs, and we intend to add more capabilities, such as identifying race conditions in the future.

If you've got questions, this is the place. Do you know people who can benefit from Racer?

Sunday, April 26, 2009

API Updates

It's been a bit quiet around here, so a few updates regarding new API under construction. The dev team is working on completing the AAA. First there's the API for argument matching, that looks like this (based on the discussion here):

Isolate.WhenCalled((int x) => fake.GetQuote("Guitar", x))
.AndArgumentsMatch((x) => x < 300)
.WithExactArguments()
.WillReturn(1000);
The second is the Swap.AllInstances which is the new MockAll. It's used for setting default behavior for all fakes from a certain type:
Isolate.Swap.AllInstances<Product>().With(fake);
Then there's controlling base class constructor behavior. You can control if a base constructor will be called or not:
var fakeDerived = Isolate.Fake.Instance<Derived>(Members.CallOriginal, ConstructorWillBe.Called,                                                 BaseConstructorWillBe.Ignored);
What do you think?

Tuesday, April 14, 2009

Following Comment Threads

Something I've noticed, and it may be just me, is that while we get some good ideas flowing on here, it's sort of difficult to hold a conversation. The problem is that I come in, read a post, read the existing comments, maybe comment myself... and never come back. I'm not notified if someone responded to the comment I just made and with all of my "myriad spare time" I don't get a chance to just surf back in and cruise the comments for every previous post and see if I should respond. I need to be proactively notified (e.g., Google Reader).

Blogger does offer a master comment RSS feed, but it doesn't put the comments in the context of the original post, so it very quickly becomes meaningless. Each entry has an RSS feed specifically for its comments, but I'm not going to subscribe to every comment feed for every entry.

I feel like the limitations of Blogger are hindering our ability to really get some good dialogue going, assuming that's the goal here.

Under that assumption (that we're trying to get some good discussions going) I considered our requirements:
  • Secure - Not everyone gets access.
  • Notification mechanism - Get notified when there's new content and/or responses to existing content. This might be RSS, email, or any other number of methods.
  • Discussion oriented - An environment that naturally fosters continued communication.
To that end, I thought of some better solutions that fit the bill.
  • Google or Yahoo Groups - Email discussion lists that have an online component so you can subscribe via email (or not), get updates via RSS, and still see the complete conversation thread so you don't lose context.
  • Community Server - Maybe overkill, but it's got forums for discussions, blogs for article-style content, and the whole package is built around community building. Drawback to this is it's not hosted.
  • Secure Forum - There are already forums over on the Typemock site. One could be locked down and the discussions could happen there. Also, RSS subscriptions allow you to get notified when things happen.
I wanted to get some feedback from folks on this. Is the blog doing what it's supposed to? Are you able to come back and adequately respond to these discussions? Or would a different medium be more conducive to conversation?

Like I said, it could just be me.

Sunday, April 12, 2009

Work In Progress: The Recorder

So here's something we started preliminary work on.

Let's say you already have an integration test. This integration test works, it calls the database, a service or any other thing, that replies with results. The test passes, and now you want to create an isolated unit test.

With the current toolset, you start from writing the same code in the test, but then you start working backwards. You run the test, it fails, you add a faking statement. You run the test again, but then it brings a wrong result from your database, so you add a statement to return a fake result, and this is an iterative process. You continue until the test passes, and it can take a lot of time until it works.We want to make it shorter, by a lot.

What we plan to do is record the integration test. By record I mean run it in a certain context (I imagine doing a right click on the integration test, "Generate unit test from this", but it can be in another way) and recording all external calls (which we currently defined as outside of the code-under-test assembly) and what they return. Then we generate code for the faking statements (or the entire unit test code).

We've just started working on that and I'll keep you posted on how we're proceeding. It's one of the ease-of-use features we're thinking of, and in advanced stages can be done just from running your app. I'll be happy to hear what you think.

Wednesday, April 1, 2009

Comments Feed

There's an RSS feed that contains all the comments on all the posts. You can use it to follow up on the comments on different posts:

http://typemock-sandbox.blogspot.com/feeds/comments/default?alt=rss

Come join us at Israel Alt.NET #2

Those of you who live in the neighborhood may be interested in joining us at the second Israely Alt.NET meet up that will take place this Thu-Fri in Tel Aviv. We are sponsoring this event with what's really important for alt.netters: snacks and bevereges!

You can find all the details in the event's Facebook page (these are in Hebrew). Sign up, join up, teach and learn!