How do you unit-test a TCP Server? Is it even worth it?

后端 未结 8 1238
一整个雨季
一整个雨季 2021-02-05 10:03

I\'m developing a small TCP server, which will process some TCP packets and behave differently based on the request.

How can I write unit test for this? If it\'s really

8条回答
  •  你的背包
    2021-02-05 10:36

    It will be well worth it.

    The number of unit tests should coincide with the type of requests (different behaviors). This will be useful when you make modifications and see if it did or did not impact other parts of the TCP Server.

    YOu can mimic sending TCP packets with several available tools out there. Let me know how it goes.

提交回复
热议问题