Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have read a lot about the importance of unit testing, and testing in general. In particular I have read about TDD which, in theory, seems like a good way to ensure effective test coverage for a project.

However, when I look at open source projects, or code that is available as open source, I am having difficulty finding good examples of testing in real projects that I can learn from. In particular I haven't seen much in the way of unit testing (at least not that I can understand).

For example I just downloaded the source code for the Java HotSpot JVM. I thought it would be very useful for me to look at and learn from because a JVM (written in C or C++) will have to deal with many complex issues associated with multithreading and low-level system interaction. Which are the very same things that I'm having difficulty in figuring out how to develop unit tests for. But unfortunately it seems like the amount of code written specifically for testing is quite limited. There is a test directory but it looks like it contains examples of code that can be used to test various different bugs, rather than any formal regression tests or unit tests.

So my question is are there examples of open source projects that use unit testing that I could look at to learn from? Something like a JVM is perfect for me because it is more complex than the project that I am working on, but would face many of the same issues associated with thread interaction and memory management.

share|improve this question

closed as off-topic by Thomas Owens Sep 17 '13 at 9:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Thomas Owens
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers

Look at boost.

Boost generally does not accept libraries for submission without complete unit tests. Boost even has a unit test framework of it's own.

share|improve this answer
add comment

Take a look at gcc and some of the supporting libraries like GMP, MPFR, and MPC.

All of them have validation suites to verify that they compiled correctly.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.