3

I'm trying to figure out the best way to load test a Windows Forms application, that hits a server and gets a response. I need to load test it for multiple users and I'm not sure if the load testing tools inside visual studio 2010 will work.

Any advice is appreciated.

Carl Weis
  • 6,794
  • 15
  • 63
  • 86
  • 5
    It sounds like what you really need to load test is the server. Calculate (roughly) how fast a single instance of your app actually *can* hit the server, then multiply by the expected number of users to get an idea of the magnitude to test. To elaborate, it's rare that the WinForms application *itself* will be under heavy load; it's just a desktop app sitting on someone's computer. If multiple copies are hitting the same server, though, then the load on the server could start to degrade performance for some (or all) users. That's why I say load testing the server seems more important here. – dlev Jul 20 '11 at 17:19
  • I agree with @dlev but if our assumption is incorrect, please clarify the question. – Amr Jul 20 '11 at 17:20
  • I'm doing a web request to register a guid with a push notification server and getting the response back, but I need to test for multiple clients doing the same thing. – Carl Weis Jul 20 '11 at 17:23
  • The Guid is unique and registered to the application instance, so I need to simulate multiple instances, so that a Guid will be generated for each instance. – Carl Weis Jul 20 '11 at 17:25
  • @Carl I stand by my earlier comment; it's the server that will be under load. You say you want to test for multiple clients making simultaneous requests. That being the case, you first have to figure out a) what is the likely maximum number of requests over an appropriate span of time, and b) how fast (or slow) can the requests take before that time becomes unacceptable to a given user. – dlev Jul 20 '11 at 17:26
  • Basically the application will hit the push notification server and depending on the response, open a window on every user's desktop, and which ever user accepts the request, their window will stay open and the others will close. So I need to test for multiple requests and responses, if that makes any sense. – Carl Weis Jul 20 '11 at 17:28
  • Ultimately, opening and closing windows on screens isn't actually a problem (though it sounds like this could result in a *lot* of annoying popups for some users.) It's still how fast the server can process all these requests that might be a concern. In that case, you would need to write a test that *simulated* send and receiving a bunch of requests to the server at once, and measuring the performance in that case. – dlev Jul 20 '11 at 17:33
  • Thanks I'll give that a shot! Yeah I agree about the annoying popups, but its a requirement for the application. – Carl Weis Jul 20 '11 at 17:34

3 Answers3

4

Here's something you can try..

  • In a test application, write a method A that encapsulates the code that makes call to the server, and receives the response.
  • In the same application, write a method B that create multiple threads. Each thread would execute method A.
  • Make sure to calculate how much time it takes to finish work on each thread.
  • Increase the number of threads to simulate more load.

Moving the code that makes the call to the server to method A without the rest of the application should make repeating the test much easier and ease the load on the client machine performing the test.

Here's sample code of a similar idea simulating load test of accessing a database C# Stress Test - Simulate multiple access to a given shared resource

Community
  • 1
  • 1
Amr
  • 1,935
  • 2
  • 19
  • 29
0

I don't have any experience with it, but if you have VS2010 ultimate try out Microsoft.VisualStudio.QualityTools.LoadTestFramework:
http://msdn.microsoft.com/en-us/library/ms243153.aspx

If you need some additional direction, here is a sample of the framework in use: http://blogs.msdn.com/b/edglas/archive/2006/02/06/525614.aspx

M.Sitter
  • 43
  • 4
0

Well, my first instinct is to create a bunch of virtual machines and run a whole bunch of your programs at once. Possibly bouncing the ip's around a little bit(I dont know how large scale this needs to be).

It might be a little rough but it would work if you simply keep adding a couple connections at a time. Obviously this wont work if you need thousands open at once. But I hope this helps a little.

-Kenetik

kenetik
  • 250
  • 3
  • 13
  • This approach doesn't scale very well. Load testing needs to be scaled very easily. – Amr Jul 20 '11 at 17:47
  • I understand, I mention that it is only ment for small scale testing, I don't know how much needs to be tested, I'm sorry for the bad post =( I am brand new to this site, and only considered an average programmer at best. I will think over my answers better in the future – kenetik Jul 20 '11 at 17:51
  • that's perfectly fine, we're all new here. It's just that the answer didn't match the basic need of "load test" which implies large scale. – Amr Jul 20 '11 at 17:55