Quite often there is a fear that surrounds open source tools and frameworks.  For most shops the deciding factor against open source software is the apparent "risk" that is associated with a framework/tool that is not attached to any business entity.

In this post I want to share an interaction that occurred this last weekend to show you that the open source ecosystem is alive and very healthy.  And while I won't go so far as to say the "risk" doesn't exist (you have to come to that conclusion on your time when your own fears are allayed) I do hope that this post puts some of those fears to rest.

Saturday morning before I went off to work there was a question posted to the RhinoMocks mailing list (for those who don't know RhinoMocks is an open source mocking framework).  Before the end of the day the problem was resolved to a satisfactory conclusion.  The "solution" (I put in quotes because there appears to be a bug but at least now we know there is a bug...hence "solution").  The result is not as important as the events that transpired to reach that conclusion below is the timeline.

12:22 AM - Kenneth posts the problem he is encountering

6:53 AM - I respond on the mailing list back to Kenneth with my findings and let him know that I will get some experts in DynamicProxy involved

6:56 AM - I enlisted the help of Krzysztof Kozmic on twitter (Krzysztof is a committer on DynamicProxy by Castle as has a great tutorial series on Dynamic Proxy)

8:38 AM - Fellow Devlicious blogger Tuna Toksoz (also a committer on the Castle project) hopped on the case and reported his findings

9:22 AM - Krzysztof responds to Tuna's findings reporting back on the root cause

10:23 AM - Kenneth reported back with feedback of Tuna's fix

Ultimately, as I mentioned earlier the fix was that it was found that RhinoMocks "relies on the buggy behavior, hence the error" (Krzysztof's words).  Again the result here isn't what is important but rather the journey.  Often people fear the support ecosystem around open source software but the exchange above and the players involved should give you some bit of confidence in the support of open source.  It is worth pointing out that all of this happened on a Saturday, something you'd pay a premium for in a closed source model.

Whatever your roll in the software world is, one aspect you have to consider when choosing any solution is risk.  The traditional thought has been that with commercial software the support would be better when backed by a reputable name.  I think the exchange showcased above demonstrates that support for open source software can compete (and potentially surpass) support that any commercial piece of software could offer.  Keep that in mind the next time you are evaluating commercial software versus open source software.


 
March 19, 2009
@ 11:01 PM

If you're serious about testing before long you'll bump into the need to do some mocking. You can of course chose to write your own mocks but that is hardly time effective or trivial.  More than likely you'll want to use a framework, but how do you choose between the most popular options?

There's been some discussion on Twitter between myself and Daniel Cazzulino (@kzu), the creator of Moq (pronounced "Mock-you" or just "Mock"), a newer and popular .NET mocking, about mocking frameworks and what goes into choosing a mocking framework.  Daniel and I share a passion in mocking and by extension testing.  As the creator of Moq, I hold him in very high regard.

The discussion centered around some work that Andrew Kazyrevich has been doing recently.  Andrew is passionate about mocking.  As such he's created an open source project which compares the "big dawgs" of .NET mocking frameworks.  In his introductory post he explains the intent, which is message I support and want to help spread:

I've started a small open source project. It provides a unified set of tests written against Moq, NMock2, Rhino Mocks and Typemock Isolator, so that you can easily compare the frameworks and make an informed decision when picking one up.

In Andrew's most recent post he compares the execution time of the various frameworks.  My response on the RhinoMocks mailing list was terse but sincere:

Curious about speed in your tests, is the a first level concern when choosing a testing framework?

Daniel answered the question in a tweet:

IMO, API design, usability and expressiveness is a much more valuable comparison. #moq is not optimized for runtime perf.

To which I responded:

I would also throw in documentation, discoverability, and community into your equation.

So, fine blog reader, I have a question for you.  If you are using a mocking framework, what are your first-level concerns when you chose your framework?  For those who have yet to utilize a framework, what will you base your decision on when you do choose?

  • Execution Speed
  • API Design
  • Usability
  • Expressiveness
  • Documentation
  • Discoverability (possibly coincides with API Design)
  • Community
  • Other?

 

About a month ago Ayende posted his thoughts on the Maturity Model found in Open Source Projects.  Ayende's method for determining maturity is simple:

From my point of view, there is a very easy model for the maturity of an Open Source project. Look at the answers in the project's mailing list. The questions do no matter.

The model is simple, the higher the percentage of answers given by non project members, the more mature the project is.

I thought of this today when I came across the group info page for the RhinoMocks and saw the statistics for this month.  I was struck by how low on the list Ayende is:

image 

You can see here that Ayende is tied for #5 on the list.  (Yes that's me on the list, but that's beside the point.)  In two polls (poll #1, poll #2) done over the last two years Roy Osherove has found RhinoMocks to be the #1 mocking framework of those polled.  I believe it is safe to say at this point that RhinoMocks is mature.  Measured with Ayende's method above and the data for this month's RhinoMocks group, I'd say that RhinoMocks is quite mature.  Ayende, the project creator/owner, sits at #5, which is pretty good.

Being familiar with open source I wanted to explore the maturity idea a bit further in depth on some other projects.  I posted on twitter a question about what open source projects people are using.  I wanted to take a few projects that are out there and explore a little bit to see if Ayende's assertion was in fact correct.

Other Projects

(Note: I am only exploring projects which have groups on Google.  These projects are in no particular order.)

jQuery

Members: 15487

image

(Note the absence of John Resig)

Castle Project

Members: 795

image

(Note the absence of Hamilton Verissimo)

NUnit

Members: 204

image

(While I would rank NUnit as "mature" Charlie Poole is the top answerer, which does not match Ayende's method)

MbUnit

Members: 353

image

(The findings in NUnit are not isolated, Jeff Brown, the MbUnit lead, is the top answerer)

NHibernate

Members: 1434

image

(This is where I started to douby my original hypothesis.  I did not expect to see project owners so high up on the list for such a seemingly mature project.  However NHibernate has a learning curve to it that may hinder would-be helpers from ever getting to the point where they can confidently answer questions regularly on the framework.)

FluentNHibernate

Members: 301

image

(Again project owner is top answer, by a long margin here).

StructureMap

Members: 209

image

(This one again surprised me a bit, especially given the work that I know Jeremy has done with documentation)

MvcContrib

Members: 302

image

TestDriven.NET

Member: 184

image

(Owner and creator, Jamie Cansdale, clearly the favorite)

Spark (Mvc View Engine)

Members: 83

image

(Owner and creator, Louis DeJardin, sits atop the #1 position)

Conclusion

When I started to dig, I wasn't sure what I find.  In many cases here the project owner is sitting right at or near the top of the top answerer list. Still, I think Ayende's original assertion is somewhat correct, however more has to be considered.  For example, a very well documented framework may lead to questions being asked that are rather difficult and therefore a larger number of questions answered by project founder may not really prove anything.  In other cases there may be a framework which is widely used but users don't feel compelled or comfortable answering questions for that group, for any number of reasons.  Ultimately any notion of what presumed before exploration was blasted to bits.

These projects above are not fringe projects, they're relatively mainstream for a certain sector of the .NET crowd.  If you haven't checked out any of these projects (admittedly I did not attempt to introduce them at all) I would encourage you do so.  One thing is for certain judging from the numbers above, these projects are viable, strong, and have a good following.

What do you think of the figures above?  Is Ayende right?  What strikes you about the projects and their discussion groups?


 
Categories: Open Source Software

February 10, 2009
@ 12:00 PM

Digging through the Castle source code look what I found in the "HowToBuild" file (note the last line):

Possible problem with 3.5
=========================
if you get the following error:
"The SDK for the 'net-3.5' framework is not available or not configured."
then you probably need to fix the sdkInstallRoot in your nant.exe.config file to point to the correct location in the registry
See the following article for more info:
http://www.timbarcz.com/blog/NantSetupForVisualStudio2008AndNet35.aspx

Looking through the file's history I can see that Ken Egozi is a pretty smart man. *wink* *wink*


 
Categories: Caslte | Open Source Software

People sometimes ask how to get involved in open source software.  In fact Scott Hanselman posted on a the subject in great detail over two years ago when detailed how you could submit a patch to an open source project.  Good intentions aside, getting involved at the source code level of a mature open source project can be quite daunting. There is a often large, hopefully active, codebase which you might not be too familiar with. Despite your sincere interest in contributing, often the startup "cost" is too great and you find that there is a sense of hopelessness in achieving that goal.  It really doesn't have to be this way.

I'd like to suggest that a great way to getting started with open source is getting involved in the mailing list for a project by answering questions posted by the community.  Nearly all, if not all, of the open source projects I use have either a forum or a mailing list associated with them.

My History in Open Source

Despite my use and open support of open source software I have to date only submitted 2.5 patches to the open source community (the 1/2 patch was me assisting in writing a RegularExpression for the developer who was actually writing the meat of the patch).  Despite my best intentions, I have yet to know an open source codebase well enough in my opinion to submit substantive contributions to the project, so I do my best to contribute in other ways.

I am currently an active participant on the RhinoMocks mailing list where I try to provide answers and guidance on RhinoMocks and testing in general.  When I made the decision to start contributing on the list, my goal was simply to beat Ayende every once in awhile to the answer...seriously, the guy is fast. As I've spent some time on the list I've become more comfortable answering questions and I've seen others jump in and help as well.  I like to think that I'm contributing to the project as a whole, if only by answering questions posed by other users of the framework. Often times, in the absence of others to assist, answering questions falls to the contributors of the project which takes away from the time they would have to further the development of the project.

If you've had a desire or an interest in getting involved and you aren't comfortable contributing via source code, think about getting involved with a project you already use and are familiar with.  Subscribe to the forum and mailing list and challenge yourself to answer a single question, then two or three. I think you'll find that the managers of these projects will be very appreciative of the help!


 
October 21, 2008
@ 10:34 PM

Last week I posted the first in a series on Mass Transit, an open source enterprise messaging system.  This series is my public exploration into messaging for our eCommerce application.  In this post I'm going to dig in to see an actual working example.  I like to see something work, then dig in to figure out how it's all put together.  We'll take a look at a simple publish subscribe example to see the messaging in action.  In later posts we'll dig in deeper into the guts of MassTransit.  That said, let's see some MassTransit in action!

Getting Started

I've downloaded the MassTransit source from the Google Code repository and am going to run one of the samples provided with the source.  We'll look at their "PublishSubscribe" sample.

image

Project Structure

image Opening the solution reveals nine projects, a few more than what I would consider a simple sample, however don't let the solution scare you away.  It turns out that you can for the most part ignore five of the projects, the mass transit infrastructure projects.

There are four parts to this solution that are relevant and we'll focus on those:

  • Client - The client represents the application that wishes to leverage messaging.  It plays the role of publisher in this example.  It is worth noting however that in this example, as we'll see, this project is also a subscriber.
  • Security Messages - This is a pretty simple project as it should be.  This project encapsulates the strongly typed messages that will be passed throughout the system.  By having the messages in their own light-weight assembly we can keep our messages separate for their consumers.
  • Server - This project acts as the subscriber.  In a normal scenario this server may be sending out emails or logging particularly interesting things as messages come through or whatever else you may have a need for.  Like the client project, we'll see that this project also plays dual roles, the subscriber as mentioned and also a publisher.
  • SubMgr - The subscription manager, is quite a mystery to me.  It may not be obvious, but the subscription manager is needed to get everything to work.  As Dru explains it to me, it is the glue.  In my first go around with MassTransit, I created a client and server and was frustrated when nothing was working.  Talking with Dru, he quickly pointed out my error, I had no Subscription manager.  In the following posts I hope to clear up some of the mystery for myself around the subscription manager.  My understanding at this point of the subscription manager, which may be a bit simplistic, is that it pushes the messages to each of the queues which are interested in the message.  A publisher publishes a message, the subscription manager is the one that ensures that it ends up in the appropriate queue(s) for consumption by various subscribers.

Getting Setup

image In order to get this sample going you first have to create the MSMQ queues that this sample expects:

  • mt_client
  • mt_pubsub
  • mt_server

You can create these queues in the Message Queuing area of the Services and Applications snap-in in the computer management area on your computer.

Seeing Is Believing

Now that we've got the project set up let's fire it up and see what we get.  Since we need all three applications running at once, the client, server, and subscription manager we can take advantage of a cool feature in Visual Studio, multi-project startup.

With multi-project startup you start any number of projects in your solution.  From the properties dialog for the solution we can choose which projects we want to kick off.  (It is worth noting the order in which I have these projects launching.)

image

What's Going On

When you run this example, the client application will ask you to enter a new password.  When you type in a new password  you will get a nearly instantaneous response letting you know the password was updated.

image 

The thing to bear in mind here is that at the point you hit the <enter> key submitting your new password, the client publishes a message and then it is done.  It appears instantaneous but you'll want to keep in mind that it is asynchronous.

The Flow Of It All

image The diagram to the right illustrates what is going on once you hit the <enter> key.

  1. The client publishes a RequestPasswordUpdate message (see the Security Messages project in the solution for this message object).
  2. The server in this case consumes the RequestPasswordUpdate message.  When it is notified of the message, it logs the new password, then...
  3. The Server publishes a new PasswordUpdateComplete message.
  4. The client consumes the PasswordUpdateComplete message and in so doing writes to the console that the password update is complete.

It is worth noting here that the client knows nothing of the server and the server knows nothing of the client.  Our example could easily expand to have multiple clients (think for example a windows app or multiple web servers in a farm).  Likewise there could be multiple server instance, each consuming different messages.  In other words, we are very loosely coupled, which is a good thing.

Conclusion

I hope this introduction to the MassTransit was beneficial.  Now that we've seen the example working, in the next post I'll revisit the idea of durability.  We'll augment this example and simulate a breakdown in infrastructure and see what durability really means, which is really at the heart of this fantastic open source library.


 
October 5, 2008
@ 08:18 PM

Yesterday Oren announced the release of RhinoMocks 3.5.  While the RC version has been out for a bit the RTM release fixes a few bugs.  You can read all about the enhancements and features in Oren's post

The feature that excites me the most about the new RhinoMocks release is the AAA Syntax (Arrange-Act-Assert).  One thing I've always struggled with when explaining mocking to people is the record replay model.  The new syntax seems to be more natural.  I have no empirical evidence to back that last statement up, only anecdotal evidence from observing fellow employees interact with the new syntax.

A close second in terms of changes is the deprecations of CreateMock().  In all the features, patches, improvements, and bug fixes this is the only item Oren bolded, which shows it's importance:

CreateMock() is deprecated and marked with the [Obsolete] attribute. Use StrictMock() instead.

This one is great for beginners who instinctively pick up the binaries and see the method CreateMock() and end up later with brittle tests.  Brad Abrams talks about the "Pit of Success" and quotes Rico Mariani:

The Pit of Success: in stark contrast to a summit, a peak, or a journey across a desert to find victory through many trials and surprises, we want our customers to simply fall into winning practices by using our platform and frameworks. To the extent that we make it easy to get into trouble we fail.

In earlier versions of Rhino it was too easy to use CreateMock() when DynamicMock() is what you wanted.  New mockers were often using the wrong method (I was one of these CreateMock() abusers/users).  The warning when using CreateMock, and the other enhancements/changes, make falling into the pit of success (with mocking) a much more likely reality.

You can download the bits from Oren's download area.  When you download, I would encourage you to make a donation to Oren's open source efforts.


 

I'm on vacation and am sitting in a coffee shop catching up on some blogs.  Sergio Pereira posted the other day his praises of the new crop of .NET screencasts.  His post explicitly calls out Steve Bohlen and his Summer of NHibernate series.  I wanted to echo Sergio's sentiments about the .NET screencasts and in particular Steve's new series.  I have used the quiet evening in the cabin to watch the excellent videos that Steve Bohlen has put out.  The quality of the videos both in production and content are unsurpassed.  I've used NHibernate before but this is a much better primer than reading a few blog posts/tutorials here and there when a roadblock is hit.

If you've not seen these videos yet and are looking for a good introduction to NHibernate, check out the Summer of NHibernate series.  When you do, make sure you donate (at least a dollar).


 
Categories: .NET | Open Source Software | ORM

July 14, 2008
@ 10:52 PM

Last week I blogged a about Unappreciated Open Source projects.  In the post I made a commitment:

From here on I've resolved to donate a dollar any time I download a free library or webcast where a donate link is presented.  Why $1?  In all honesty it is something I can commit to.

I'm thoroughly looking forward to watching the Summer of NHibernate next week while on vacation.  As I was downloading the videos I came across the "donate" link so I whipped out my Paypal account and made good on my promise.

image


 
Categories: Open Source Software | ORM

July 9, 2008
@ 09:13 PM

Many people use open source tools, whether its NUnit, Nant, Rhino, or log4net in their professional lives.  If you use any of these tools, when was the last time you donated time and/or money to any of the open source tools you use?  That's what I thought. 

I was recently watching the Hibernating Rhinos from Ayende Rahien and I wanted to thank Oren.  Right there on the Hibernating Rhinos page it reads:

donate

I wanted to donate.  Perhaps because the videos provided so much guidance from one of our industries finest.  Perhaps because I've met Oren and generally think he's a good guy.  Regardless, I donated some money.  Not much, but some.  Something to say, "thank you, I appreciate this.

Curious if other donate, I emailed Ayende to see what revenue, if any, his video series has generated.  I wanted to know well the community was supporting a popular training tool.  Here's the stats, lifted a few moments ago.

image

So how much has Oren received from this video series?  Guess.  Seriously.  $125 since September 2007.  From the stats above there have been 242,610 downloads of the videos. That breaks down to .000515 per download!!!  As a community that's quite pathetic.

From here on I've resolved to donate a dollar any time I download a free library or webcast where a donate link is presented.  Why $1?  In all honesty it is something I can commit to.  I download and use a lot of tools, so I don't want ongoing cost to hinder me.  $1 is a token to say thanks, acknowledging the work that's been put into the product.  I would challenge you to make a similar commitment for the tools you use.  Let's show the author(s) of these tools/libraries that we do appreciate the work they do!


 
Categories: Musings | Open Source Software

"But you have the source!"

I heard that statement a little over a month ago at the Alt.Net Open Spaces event in Seattle.  It's no secret to those who know the community, that open source technologies are at the very least promoted and in many cases you'll find many open source project committers within the Alt.Net community.  Heck, David Laribee, a founding member if there is such a thing, in a post defined Alt.Net as (emphasis mine):

  1. You’re the type of developer who uses what works while keeping an eye out for a better way.
  2. You reach outside the mainstream to adopt the best of any community: Open Source, Agile, Java, Ruby, etc.
  3. You’re not content with the status quo. Things can always be better expressed, more elegant and simple, more mutable, higher quality, etc.
  4. You know tools are great, but they only take you so far. It’s the principles and knowledge that really matter. The best tools are those that embed the knowledge and encourage the principles (e.g. Resharper.)

The quote, and many like it, came in a session titled "Mature Open Source projects versus first generation Microsoft projects".  The discussion centered around why some (many) developers, managers, and executives feel comfortable choosing a brand-new Microsoft product when a far more mature open source alternative exists.  One the fears surrounding the adoption of open source is the lack of surety that open source project will exist in perpetuity.  One needs to look no further than two projects, NVelocity and NDoc, to find historical evidence of an open source project vanishing.  The main counter-point to that argument, and many others, was the quote above, that with open source, you were never truly left high-and-dry, since you had the source.

It's a noble thought, but really, who wants to manage another codebase in addition to their own?  In fact I turn to open source project many times so I don't have to write my own code.  Why re-invent what someone else has already done and guided to maturity?  The idea that I can compile and manage another, possibly large, and probably complex codebase is hardly a comfort to me.  It wasn't until a few weeks ago that I realize that the open source pundits were correct.

I have been working on a project for the last year that has, as of two versions ago, started using Watin to automate the downloading of a file from the internet.  Watin is a testing framework but is used by many to automate business processes, which is what I use it for.  If you haven't checked it out yet, it's beautifully simple.

Watin provides handlers to download a file, however, the code was hanging at the point where it should've cleared the download.  I looked at every documentation page, blog post, and blog comment I could to see if I was missing something.  My usage was correct.  So I dug in a bit further using WinDowse to find the handle of the button that should be clicked.  As it turns out the handle of the Save button in a FileDownload Dialog changed from 4424 to 4427 in IE7, who would've guessed it right?  Well, since I had the source I went in and made the change, and voila, I'm back in business.

It gave me some confidence that if an open source project does cease, I can pick it up and patch it up.  I still don't want to manage multiple codebases from many different source, but in the end the pro open-source guys were right, "You have the source!"


 
Categories: .NET | ALT.NET | Musings | Open Source Software | Software

I'm having a problem with my nant script which uses the Nant.Contrib library in order to build using a solution file.  The error currently reads, "MSBuild can only read solution files between versions 7.0 and 9.0 inclusive."

Unfortunately at this time I can't find much information anywhere about this.  Either people aren't using 2008 yet or aren't using Nant.

Any smart people out there that can comment on this?

Update:  I had to search a little bit harder, given that VS2008 only went RTM a bit ago.  I did find that Jeffrey Palermo posted a solution to this a few days ago (11/28).  His fix is to modify the nant.exe.config file so that it can recognize the new framework and thus point to a new version of the msbuild.exe.  Thank you Jeff!


 
Categories: Nant | Open Source Software