Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could you recommend any open source projects where the source is extensively tested with unit tests? [closed]

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++.

like image 1000
Bill Avatar asked Oct 25 '08 09:10

Bill


People also ask

Should unit tests be in their own project?

Yes. Your unit tests should be a separate project, which compiles to its own DLL. Save this answer.

What should be tested using unit tests?

The purpose of a unit test in software engineering is to verify the behavior of a relatively small piece of software, independently from other parts. Unit tests are narrow in scope, and allow us to cover all cases, ensuring that every single part works correctly.

Is unit testing possible or even desirable in all circumstances?

Unit testing may not be possible in all situations. When object-oriented software is considered, the concept of unit testing changes. Encapsulation drives the definition of classes and objects. This means that each class and each instance of a class packages attributes and the operations that manipulate these data.

What do you have to avoid in tests in unit testing?

Avoid Test Interdependence You, therefore, cannot count on the test suite or the class that you're testing to maintain state in between tests. But that won't always make itself obvious to you. If you have two tests, for instance, the test runner may happen to execute them in the same order each time.


2 Answers

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.

like image 72
Paweł Hajdan Avatar answered Nov 09 '22 14:11

Paweł Hajdan


The Chromium project.

like image 25
Bernard Avatar answered Nov 09 '22 15:11

Bernard