views:

34

answers:

2

What methods are there to test how well a C# desktop application handles various network/internet failures, and which, if any, failures it doesn't handle?

Thanks in advance.

+2  A: 

Not an official test but still useful is the good old "yank the cat5e from the wall" test. You'd be surprised how many applications simply crash.

Peter Hanneman
Works best if you can set up to simulate a long-running transmission. That way you can be certain you cause the outage in the *middle* of a transmission.
Toby
A: 

I recommend at least the following:

1) As Peter recommended, yank the cable. This should be done on both server and client machines.

2) A more subtle test is to yank the cable on an intermediate router, so both computers still "see" the cable is connected. This often results in a half-open connection.

3) Another test is to crash one side but leave the OS connected (e.g., Task Manager's End Process). This should also be done on both server and client machines.

These all test different errors and are pretty simple to do.

In addition, you could write an "error simulator" that acts like a badly-behaved client or server implementation. Have it try to send huge messages, or violate the protocol, or send data when it's not supposed to... There are many possibilities, depending on the protocol.

Stephen Cleary