问题
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++.
回答1:
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.
回答2:
The Chromium project.
回答3:
I wouldn't call it extensively, but wxWidgets does some UnitTest with CppUnit.
回答4:
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.
回答5:
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.
来源:https://stackoverflow.com/questions/236156/could-you-recommend-any-open-source-projects-where-the-source-is-extensively-tes