This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes Concurrency Testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Concurrency Testing" Watch "Concurrency Testing" New topic
Author

Concurrency Testing

Paul Croarkin
Ranch Hand

Joined: Sep 30, 2004
Posts: 106
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.


Thanks,<br /> <br />Paul Croarkin<br />SCEA 5, SCWCD, SCJP
Cedric Beust
author
Ranch Hand

Joined: Oct 12, 2004
Posts: 46
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Concurrency Testing
 
Similar Threads
Spring Persistence with Hibernate: Advanced Topics
Multiple clients in RMI
Some industrial terms need to be understood
best practises
ajax app - testing xml post