This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 689
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
It is sorta covered in the JavaRanch Style Guide.
subject: Stress test in Java Web application with Cucumber?
Similar Threads
Free Web App Stress Tool/s?
Does Java has equivalents to Cucumber and RSpec?
BDD framework
Minimum jar's to run Simple Cucumber with Junit
Writing JUnit 4 tests in JRuby