Wednesday 20 November 2013

Activities involved during performance testing

In this post we will see different activities involved during performance testing of any application.

Activities performed-

  1. Tool Selection
  2. Create user scenarios
  3. Scripting
  4. Dry run of the application.
  5. Running a load test and analyzing the result

Tool Selection -

There are different tools used to measure performance like JMap (Heap memory usage, Creating memory dumps), JHat (Analyze the memory dump), JStack (Thread count), JConsole (Heap memory - graphical) , JMeter (API response), EhCache monitor (To see cached objects), PerfMon (Client side CPU, memory), YourKit (Server side CPU, memory, thread count) , Simple commands like top, free (Linux) and task manager (windows)

Depending upon the type of application and language support look for any open source or commercial performance tools convenient for your application

I have used jmeter for web based application implemented in java to measure API response time and EnCache monitor to check if cache is hit or not for whatever request.

User Scenario -

The test scenarios for performance test are based on different setup that needs to be tested. Hence as per the setup the test scenarios are executed:
  1. What is anticipated average number of users ?
  2. What is anticipated peak number of users ?
  3. How does application manage cookies, session-rewriting or any other method ?
  4. What is the testing intended to achieve?

Scripting -

There is a requirement to replicate the real scenario of production system. The data loading process is is a repetitive task for populating database.This include test setup preparation or creation i.e. per-requisite for running the performance tests and to load heavy data into the database.
These activities are automated with scripts.

Scripts are require for post test cleanup to restore back to original state for another performance run.

Dry run of the application -

Once the setup is ready it gives a brief insight into your application performance. Execute the performance run to obtain the initial performance result. Studying the results, decide the component to keep focus on. Also measure the performance result with different number of threads, ramp-up time, consider latency and tomcat configuration.
In all testing, response time should be ideally below a capped benchmark to particular values.
Dry run is necessary to setup ideal configuration of server and client. Final Performance results are carried on this setup. 

Running a load test and analyzing the result -

After executing a load test we need to interpret the result. For result interpretation we use Listeners that provide different metrics about the load test.

Performance suite should not be run only once it might give an inaccurate reading. For example, some requests fires multiple queries internally. The first request is going to be slow because a database hasn’t cached it yet. After results are cached every following request will take significantly less time. So the results are calculated as an average of three runs.

To know more about performance result analysis read my post on performance test result analysis read it here.


No comments:

Post a Comment