I am currently developing Client/Server app based on TCP protocol in C/C++ and want to perform unit tests of both client and server side. I am using unix sockets for development. Are there any MOCK libs or something similar to be used in testing or do I have to make wrappers in order to perform tests? Do these tests have to be local or they can be performed on network?
Asked
Active
Viewed 2,162 times
2
-
1Unit tests must by definition be executed in isolation, so there's no running them over an actual network. – Quentin Oct 06 '17 at 14:48
-
1Your question would probably be better suited to https://softwarerecs.stackexchange.com – Steve Lorimer Oct 06 '17 at 14:49
-
unit testing implies local. on a network would be integration testing. However, it can be useful to build a mock server and run it locally. – Richard Hodges Oct 06 '17 at 14:50
-
Google Test supports both testing and mocking – Asesh Oct 06 '17 at 15:19
1 Answers
3
There are at least a few test frameworks you can use. For example Google test which can include Google mock. There are a variety of different tests you can develop for your application.
For unit tests, you must not use the network. The idea is to test only the logic.
But there are other tests that can be made which will use the network. These tests are called system tests because they test the whole system.

Petar Velev
- 2,305
- 12
- 24