导航

[转]看看cppunit的作者是怎么定义unittest的.

Posted on 2010-09-30 11:41  maconel  阅读(190)  评论(0)    收藏  举报


Here are qualities of good unit tests:

They run fast.

They help us localize problems.

A unit test that takes 1/10th of a second to run is a slow unit test.

Unit tests run fast. If they don't run fast, they aren't unit tests.

Other kinds of tests often masquerade as unit tests. A test is not a unit test if:

It talks to a database.

It communicates across a network.

It touches the file system.

You have to do special things to your environment (such as editing configuration files) to run it.