


Introduction
Continuous integration (CI) is an important part of our development cycle. We use CruiseControl.NET to manage CI for all of our projects. CruiseControl.NET monitors SubVersion, watching for source code check-ins and fires off a build after every check-in. This of course includes running all tests for the solution being built. If compiling the solution has no problems and all of the tests run successfully, then CruiseControl.NET gives the project a "green light" or a successful status. If anything goes wrong, CruiseControl.NET gives the project a "red light" or failed status.
CruiseControl.NET also ships with a small utility that shows the build status as a colored indicator in the system tray. It plays different WAV sounds to indicate the status of the builds.
You would think that the sounds and the colored tray icons would be enough... Not for us! We want MORE! We want lights, sirens, shocking mice! Visiting the C2 Wiki proves that we are not the only ones to want a clever build indicator. In fact, it was there that we saw the first "Ambient Orb" from Ambient Devicesto be used as a build indicator. We rushed out to the mall to buy one for about $100 from the Discovery Store. We used Ambient Devices "pager" service to send the build status to the orb; however, we were disappointed to find that there was a 5-15 minute delay from the time the build finished to the time the Orb would change colors. The delayed results weren't good enough. We need immediate gratification, so we ordered the developer's toolkit from Ambient Devices, too. It allows us to plug the Orb in to a serial port and send commands directly to it. Finally, we have what we need to get real-time build statuses from our Orb!
The following article demonstrates how we wrote RapidOrb, our build indicator lamp, using a test-driven approach. We will be using C# in VS.NET 2005. Other important tools used are NUnit, TestDriven.NET, NMock, and NAnt.
Just Give Me The Source!
We understand that there are some of you that really don't want to read the article. You just want to see the source code. (We can be that way sometimes, too.) So rather than make you wait until the end of the article, here is a demo version of RapidOrb .NET Solution. Enjoy!
User Stories
We're going to start out with some user stories to show where it is we're headed. We're not necessarily going to have time to complete all of them, which is why we've kept each story small and they're in priority order. This is to give you a sense of the big picture.
Story: Red Orb / Green Orb
Developers want the Orb to change to red when any build fails. And only when no builds are broken should the Orb change to green. (Note: must support multiple projects.)
Story: Flashing Purple when Building
Developers want the Orb to change to purple and flash when Cruise Control is busy building any project.
Story: Disable the Orb's Pager
Developers don't want the Orb's color to change whenever Ambient sends a page to the orb.
Where would you start?
Would you start with a Big Design Up Front? Would you start coding?
We started by... (yeah, click here to continue)