8

Programming is learned by writing programs. But code reading is said to be another good way of learning. I would like to improve my unit-testing skills by reading, examining real-world code. Could you recommend any open source projects where the source is extensively tested with unit tests?

I'm interested in code written in C++.

Bill
  • 11,595
  • 6
  • 44
  • 52

5 Answers5

8

AFAIK C++ Boost libraries - http://boost.org/ - have broadly covered code base, and a policy that every new piece of code must have unit tests with it. Might be worth checking.

Paweł Hajdan
  • 18,074
  • 9
  • 49
  • 65
4

The Chromium project.

Bernard
  • 45,296
  • 18
  • 54
  • 69
1

I wouldn't call it extensively, but wxWidgets does some UnitTest with CppUnit.

1

The Bazaar version control system is obsessive about automated testing. Unit testing, feature testing, integration testing, blackbox testing, test doubles testing, testing framework testing, parameterized test suites, platform-specific tests, etc.

This has all sorts of nice consequences for the project, but I must refrain here from undue VCS fanboying.

EDIT: oops, I did not notice you said you were interested in C++. Bazaar is a Python project.

ddaa
  • 52,890
  • 7
  • 50
  • 59
1

The trucov project is an open source tool used to verify unit test coverage. The tool itself is extensively unit tested using google's test framework.

Disclaimer: though I did not write the project myself I did mentor the students who did.

deft_code
  • 57,255
  • 29
  • 141
  • 224