File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Stress test in Java Web application with Cucumber? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Stress test in Java Web application with Cucumber?" Watch "Stress test in Java Web application with Cucumber?" New topic

Stress test in Java Web application with Cucumber?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 690
Is it possible performing stress tests in Java Web application with Cucumber?

Matt Wynne

Joined: Feb 17, 2012
Posts: 14
Hi Rogerio,

Yes, it is possible. The way to do it is to specify concrete examples of scenarios that the system will find itself in under stress. For example:

Given 1000 users are hitting the homepage simultaneously
When I request the homepage
Then I should get a response within 2ms


Given there are 100,000 users registered on the system
When I create a new account
Then I should be taken to my dashboard within 5ms

Talking through these kinds of scenarios with your stakeholders will help you to understand where the boundary is for what they consider to be acceptable performance. Now you have agreement about this, the next step is to work out how to automate these scenario, by calling your load testing tool of choice from the Cucumber step definitions.

The key thing is to have Cucumber delegate to the stress testing tool, rather than the other way around. A common mistake people make is to simply point JMeter at existing Cucumber scenarios, but this doesn't give you the benefit of having the parameters of the test documented in a readable Cucumber scenario.

These are not normal kinds of Cucumber tests. You would need to run these against an environment that's representative of your production hardware, whereas normal behaviour scenarios could be run against any environment. It's useful to create these scenarios early on during the project and run them against every build so they become constraints within which the project must proceed.


Freelance programmer & coach
I agree. Here's the link:
subject: Stress test in Java Web application with Cucumber?
It's not a secret anymore!