robcee on Quality, Code and The Internet

July 5th, 2006

Hello World. Welcome to my corner of it. Let me tell you a bit about myself and what I do.

I’ve got 10 years of experience in Object Oriented programming. My weapon of choice for most of that has been the Smalltalk programming language. I’ve worked as a consultant for government and private industry. I’ve also been a C programmer since learning the language and hacking on my Amiga way back in my high school years. I’ve done C++ and Java programming too. But enough about me…

One of the cool things about the Smalltalk community and the “eXtreme Programming” movement that came out of it was the push for better testing in code. In addition to some of the other tenets like, pair programming and iterative development, unit testing is one way to gather solid metrics on code quality and ensuring regressions don’t occur when new code is committed. With a unit testing framework, a developer can run the full set of tests and know quickly if any of their changes have broken something else in the code base.

a note on “units” — What is a “unit”? It can be a module, a class, a method or even a single block of code. Any encapsulation can be considered a unit and is up to the developer to define. A suite of tests can be written to test correctness of the unit and assert that a piece of code evaluates to true.

How can this work in the Mozilla Project? Unfortunately, some of the things which make unit testing so easy in a language like Smalltalk or Java are going to be more difficult in a large, compiled code base like Mozilla’s. It is not a simple matter to write a unit test, recompile the whole application and check your results. The turn-around time is too large. Worse, there are multiple platforms to run the tests on. A fully-passing test-run might not pass on another platform or even system configuration. While it might be possible to test some units in isolation, the majority of the tests will likely require a full rebuild of the app.

In order to allow testing of multiple platforms, we will need a testing farm, likely running on VMs with each reporting to a separate unit-test tinderbox.

Currently, I’m setting myself up with a development environment and investigating MinUnit. It is absolutely the lightest-weight-possible testing framework, but it’s totally open and easy to modify. Once that is in place, I plan on looking at CxxTest which got some positive review in this excellent article.

Once some proof-of-concept code is in place, I plan on working with the Zach and the build team on setting up our test servers and a tinderbox. Big plans. I will stop talking now and get to work…

Posted in Code, Quality | Comments (0)

Leave a Reply

Powered by WP Hashcash