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.
浙公网安备 33010602011771号