Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are several steps that I take when testing client server systems and mostly I tend to use "normal" unit testing frameworks for this kind of thing, though it only works if you've already designed your code to be unit testable. I also often write a specific stress test client for the server; this can create many thousands of concurrent connections and perform operations on the server and check that it gets the expected results.</p> <p>For initial server testing you want to have a set of unit tests in place for the key server components; message parsing, etc, and you want to have isolated these components from the code that actually deals with the network (so that you can test it all in a unit test). Push data into the server's message parser and make sure that it parses correctly, and calls the right things, etc.</p> <p>You can then use your normal unit testing framework to create an instance of your server object (with suitable mocks) which listens on the network and then create a simple client which you instantiate within the unit test and which tests aspects of the server. Often you'll find that there are only a small number of things you actually MUST test like this. Normally connection establishment and termination issues which you want to test with the network as well as independently of it (after all, you can call the connection establishment and disconnection code on your server class from a normal unit test anyway).</p> <p>Finally you need a custom client which understands your protocol and can put pressure on the server with 1000s of clients - this is the best way to drive out performance and threading issues.</p> <p>I tend to work on all of these things from the very start; see <a href="http://www.serverframework.com/asynchronousevents/2010/10/how-to-support-10000-or-more-concurrent-tcp-connections---part-2---perf-tests-from-day-0.html" rel="nofollow">this blog post</a> for more details.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload