On 4/30/2014 1:36 PM, Andrei Alexandrescu wrote:
One good example is networking tests - if I worked on an airplane I'd love to
not test tests that need connectivity with a simple regex.

I am suspicious that testing networks with a unit test is an inappropriate use of unit tests.

Unit tests should be testing individual functions. The "network" for those tests should be a mockup, not the actual network. A mock network:

1. can model extreme, unusual, perverse, and corner cases of networks, whereas real networks try to avoid that

2. will generate reproducible results


Testing networks should be more of a system test, not a unit test.

Reply via email to