Leo's Technical Blog

Interesting Open Source Surprises

Introduction

user

Leo Soto


me, oss, mochikit

Interesting Open Source Surprises

Posted by Leo Soto on .
Featured

me, oss, mochikit

Interesting Open Source Surprises

Posted by Leo Soto on .

I really wanted to blog about this. You know, working on Open Source is quite fun, with all the advantages everyone can think about: satisfying curiosity, learning from really smart people far away from where you live, solving actual problems in an efficient way, among many others. But, aside from what you expect from Open Source when you get involved on it, reality still can beat your imagination.

Almost 3 years ago, I wrote a few lines of code to improve the testing of MochiKit, basically because MochiKit was a really good library, but it couldn't be tested on IE5.x which we need to support at Imagemaker by request of a customer. The testing mini-framework I wrote offered the same interface as Test.Simple so was unsurprisingly called SimpleTest. And it got quicky accepted as part of MochiKit. That was great, as we didn't had to maintain patches against MochiKit anymore!

But once I moved from developing some brand-new web applications to maintaining and fixing some legacy systems (which tends to demotivate me, but that's another history), I wasn't able to develop with MochiKit anymore. Thus, I lost track of what happened to SimpleTest, though I knew it was probably being maintained by the great people behind MochiKit.

What I didn't knew was that at some point the Mozilla guys took MochiKit's tests and used it for testing the browser and the HTML rendering engine (Gecko).

As you can imagine, it was a happy surprise to see the ugly green box of SimpleTest on the blog of John Resig, showing a 100% passing test, which kind of certified that Prototype ran on Firefox 3.0 (more than a year ago):

Or some reference about the SimpleTest API on the mozilla wiki!

If you ask me, as many other Firefox users, I'd be happy to give something back to the Firefox develpment. Now, knowing that you have given something back without even thinking on it is really interesting.

Anyway, you may ask, what's the deal? Obviously Mozilla wants to test its Javascript engine by testing Javascript libraries. It makes a lot of sense. But is the kind of reuse that you don't envision when you write such little pieces of software as a mini Javascript testing framework. Or not so little things like a whole Javascript framework, as I guess Bob Ippolito didn't thought on helping the testing process of a browser when he released MochiKit into the wild. Or really big things like Django being used on Google App Engine. I know that neither Jacob nor Adrian thought Django would be used on such way back on 2005 (and possibly didn't until they got the news from Google some months ago)

As you may have expected, I posted this to say "Hey, my little code made its way into mozilla infrastructure". But that's only half of the history.

The other half (and the only important, for anyone reading this) is that this kind of reuse wouldn't be even possible without Open Source. Other people can use your code for things you didn't knew it would be useful. Your code is not restricted by your own, limited vision. That is pretty cool.

[Oh, and by the way, looks like SimpleTest is going to be finally merged with MochiKit.Test, which takes care of testing Javascript outside the browser. That's possible thanks to spidermonkey, the standalone Mozilla's Javascript engine! Sounds like a healthy symbiosis relationship to me...]