tags:

views:

350

answers:

16

For reference, I'm looking for some open source projects with unit tests.

Edit - Surely there must be more!

+2  A: 

OpenJDK has a very comprehensive set of conformance tests that are required to pass in order to be considered a valid implementation of Java. :-)

Chris Jester-Young
A: 

Chestnut Package Manager (advertisement)

Stefano Borini
+6  A: 

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.

Mark Rushakoff
Wow, very interesting stats. Thanks Mark.
They automatically generate those stats on the web page with each new release. That makes my programmer insides feel warm and fuzzy. :)
Mark Rushakoff
This fuzziness is infectious :)
Igor Brejc
+1  A: 

A few examples:

Emil H
+1  A: 

Looks like Groovy has a bunch. You can see when they fail on their CI server.

timdisney
+3  A: 

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 :-)

http://aspnet.codeplex.com/SourceControl/BrowseLatest

Joel Martinez
A: 

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.

Freddy
I disagree with your conclusion: that tests are not as important in open source. Not having tests hinders novice contributors from making changes without fear of regression.
Andres Jaan Tack
+1  A: 

Many of the Boost libraries have unit tests, so do many of the implementations of Google Protocol Buffers

Alex Black
+2  A: 

Spring is loaded with JUnit tests.

duffymo
Plus the PetStore, which could be thought of as a functional test
skaffman
+1  A: 

Ruby On Rails has lots of unit tests, and most of the popular extensions (plugins/gems) have unit tests as well.

Osseta
+1  A: 

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.

John Saunders
+1  A: 

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

AutomatedTester
A: 

The NUnit unit testing framework has code to test itself. I'm sure the same is true for all other unit testing frameworks.

Wim Coenen
A: 

My project JMockit (a toolkit for developer testing, particularly for unit testing with mocks) contains a good number of tests, mostly using JUnit 4.

This sample test suite, for example, contains 150+ unit tests.

Rogerio
A: 

The Factor programming language has around 42 thousand lines in its test files.

Brian
+1  A: 

Mark Pilgrim's Feedparser bills itself thusly:

Parse RSS and Atom feeds in Python. 3000 unit tests. Open source.

anthony