Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concurrency Testing

 
Paul Croarkin
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the best way to do concurrency testing? We have testers do some load testing as part of acceptance testing. We also use JUnitPerf in a limited capacity as part of our regular build.

How do you determine what parts of the app need concurrency testing? I'm guessing it would be best to do some sort of concurrency testing at the functional level based on use-cases / user stories.
 
Cedric Beust
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Originally posted by Paul Croarkin:
What is the best way to do concurrency testing? We have testers do some load testing as part of acceptance testing. We also use JUnitPerf in a limited capacity as part of our regular build.

How do you determine what parts of the app need concurrency testing? I'm guessing it would be best to do some sort of concurrency testing at the functional level based on use-cases / user stories.

TestNG has several features that can help with that.

For example:

@Test(invocationCount = 1000, threadPoolSize = 10, timeOut = 5000)
public void invokeServlet() {
// ...
}

This will tell TestNG to invoke this method 1000 times from 10 different threads. If any of these threads fail to return without 5 seconds, TestNG will mark that invocation as a failure.

Once this is done, you can have another test method that depends on this one that will check that, for example, the database is in a healthy state, thereby showing that the code under test is most likely multithread safe.

TestNG also lets you run your tests in parallel in all sorts of ways, please take a look at the Web site (http://testng.org) for more details, or ask here.

--
Cedric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic