[Logo]
Forums Register Login
Concurrency Testing
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.
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
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 20, 2017 23:55:23.