For reference, I'm looking for some open source projects with unit tests.
Edit - Surely there must be more!
For reference, I'm looking for some open source projects with unit tests.
Edit - Surely there must be more!
OpenJDK has a very comprehensive set of conformance tests that are required to pass in order to be considered a valid implementation of Java. :-)
SQLite has a very comprehensive test suite. It may not be unit testing, per se, but it is quite comprehensive.
As of version 3.6.16 (all statistics in the report are against that release of SQLite), the SQLite library consists of approximately 63.9 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or, in other words, lines of code excluding blank lines and comments.) By comparison, the project has 709 times as much test code and test scripts - 45385.9 KSLOC.
A few examples:
The ASP.NET MVC Project, whose source code can be seen on codeplex, has a very complete set of unit tests. It can even be browsed online :-)
I think you will find some Open Source projects which had some type of unit testing. But watch out for what you are trying to do with that information. Remember an Open Source project is a collaborative work between developers. Code goes around back and for and several people take a look at it before the code is even compiled in for final release. So, even when unit testing is not predominant in most open source projects, the quality of the code is guaranteed by the peer review/testing done by several people at the time.
On the other hand, on common enterprise projects you have a group of developers, each one working in a specific part of code and interacting between other developers methods and functions. Since only a few very busy people are looking at the big picture Unit Tests are a must on those projects. So, when a developer put something new, we needs to be aware that we does not broke somebody else code. On open source project, that somebody will probably send you a nasty e-mail as soon as he installed your patch.
Just be aware that both techniques should not be compared side by side.
Many of the Boost libraries have unit tests, so do many of the implementations of Google Protocol Buffers
Ruby On Rails has lots of unit tests, and most of the popular extensions (plugins/gems) have unit tests as well.
If you consider CodePlex projects to be open source, then look at the Service Factory. There were over 700 tests in there when I extended the source last year.
All the Selenium tools have good amount of tests.
Selenium core and Selenium IDE have jsunit tests and Selenium RC has JUnit tests. The source code can be found here
The NUnit unit testing framework has code to test itself. I'm sure the same is true for all other unit testing frameworks.
The Factor programming language has around 42 thousand lines in its test files.
Mark Pilgrim's Feedparser bills itself thusly:
Parse RSS and Atom feeds in Python. 3000 unit tests. Open source.