Thursday, June 9, 2011

Stress Testing Approach

  • Identify test objectives
  • Identify key scenarios
  • Identify the workload
  • Identify metrics
  • Implement test cases
  • Simulate load and Run
  • Analyze results
Objective of Stress Testing:
To observe the results when testing our web-site beyond normal operational capacity, till its breaking point by slowly increasing the load.

Key scenarios:
In first test case, there are ten threads, particular number of users will access home page, and top menu options like “About Us”,  “Service Offerings”, “Careers”, “Contact Us”, “Home”, “Policies”. 

Defining Workload:
Starting from 100 users, we are increasing user count by 200, 400, 800.. till No response from server. All these virtual users are simultaneously accessing with the functions given under key-scenarios.

Metrics to be collected:
Average Response Time and Throughput values will be collected after execution.

Sample Test cases:
1.Open Jmeter
2.Add 10 Thread groups under test plan
3. Do proxy setting and record the following functions for each thread groups
           a. Open http://exampleworld.com
           b. Click on “About Us”
           c. Click on “Competency”.
          d. Click on “Service Offerings”.
          e. Click on “Careers”.
          g. Click on “Resource Centre”.
          h. Click on “Contact Us”.
          i. Click on “Home”.
          j. Click on “Polic” .
4. Set No. Of Threads = 10 for each thread group.
Ramp-up period = 0
(No of simultaneous users now = 100) and RUN Jmeter
5. Repeat the 4th Step by increasing No. Of threads by 10
each time till No response from server. ( 10, 20, 30 ...)

Implement test cases in JMeter:
In Jmeter record the steps given in Test cases in the same way as explained in functionality Testing.

Simulating the load and Execute:
Set No. Of Threads = 10 for each thread group.
Ramp-up period = 0
(No of simultaneous users now = 100) and RUN Jmeter
Repeat the above steps by increasing No. Of threads by 10 each time till No
response from server. ( 10, 20, 30 ...)

Results Analysis :
For 100 users
Average Time taken : 1.67 Seconds
Throughput : 34/Sec

For 200 users
Average Time taken : 3.73 Seconds
Throughput : 31.6/Sec

For 400 users
Average Time taken : 5.32 Seconds
Throughput : 29.5/Sec

For 800 users
Average Time taken : 8.43 Seconds
Throughput : 28/Sec
No Response for 840 Users.

Conclusion :
Approximately 800 users can access the server by the given functions.


No comments: