Friday 1 January 2010

The rise of unit testing in open source software

I'm spotting a trend. A trend for unit testing.

We've always known we should unit test, but not many of us have done it wholeheartedly.

Only now are we starting to see the advantages.

With the rise of distributed version control, sites like github and improved merge tools, we're starting to see the real power of open-source software - but it comes at a price. We seem to have entered a phase of software development where, for some projects, the philosophy is "let 1000 branches bloom". The only way to allow this explosion of user generated functionality, while preserving quality, is via automated regression tests.

As a Python guy, I'm thinking of projects like Django and Twisted, but that could apply equally to projects in C, like redis, or any other language for that matter. Perhaps this means that languages with easy access to unit testing functionality will really start to prosper in this new era.

Within a large open-source project, no individual contributor can hope to be a master of all of the functionality - therefore the only way to ensure that people can contribute new functionality without having an adverse effect on the bulk of the legacy code is via automated regression tests. In this day and age, its not realistic to develop a system with a large number of contributors without having a means to allow those contributors to add to the codebase in confidence that they're not going to break a piece of critical functionality.

Unit testing is "a good thing", and we're starting to see the real benefits.

No comments: