~robcee/ field notes of a pyroentomologist, now 33% snappier!

Posted
7 October 2008 @ 5pm

Tagged
Code, Firebug, Mozilla, Testing

FireUnit – the early years

One of our goals for moving forward with Firebug is to build a system to run automated unit tests for it. Currently, Firebug is modified, packaged and then tested by a small (but enthusiastic!) group of developers. When changes are made to the codebase, the area under development might be tested by the developer, but there’s no way of knowing if what you’ve done has broken some other part of the application. As a friend of mine is fond of saying, software is hard.

Enter FireUnit! An extension for Firebug that aims to be able to test Firebug itself, and later on, perhaps be a useful framework for developing unittests for the web. It’s still very early on, but there’s a core emerging.

Installing FireUnit is currently a bit of a manual affair. Download the source code from the github repository and extract the downloaded zip or tar file to your local filesystem.

Open your profile/extensions directory for the Firefox profile that you use with Firebug. Create a new empty text file there with the name “fireunit@mozilla.com” (no quotes, of course). In this text file, add the full path to the FireUnit directory you unpacked in the previous step. E.g., “/Volumes/Data/Projects/FIREBUG/fireunit” in my case.


Test panel of FireUnit after running commandline.html

When you open/restart Firefox with this profile and open Firebug, you should now see a new “Test” panel in the list of tabs. Go to the location bar and type in / paste chrome://fireunit/content/test/commandline.html. You should see some flickering as FireUnit runs through the tests in that commandline.html. When done, you should see a bunch of passes listed in the Test panel (hopefully no failures!).

While I’m rambling about testing, I should mention that there will soon be a new alpha version of Firebug 1.3 (a4) available for download at getfirebug.com/releases/firebug1.3. This would be an ideal version for you to try out FireUnit on! For the more adventurous in the crowd, Chromebug 0.3a8 is R261 on https://fireclipse.svn.sourceforge.net/svnroot/fireclipse/trunk/FireclipseExtensions/chromebug.


2 Comments

[...] improvements to FireUnit include a test-runner mechanism for running through a set of chrome files containing unittests. [...]


Posted by
Simon
3 November 2008 @ 4am

Application is being used in fireunit, which is a firefox 3 feature. Besides Applicaiton, will fireunit work in Firefox 2.X?

I get “fireunit is not defined” error when I run commandline.html.


Leave a Comment

Powered by WP Hashcash