This is the guest post from Anmol Rastogi, he is currently working as QA Manager in the Cognizant Technologies, Pune. He is having total 11 years of experience in the IT industries.
Performance testing is the testing technique used to determine the performance components of a particular system/ application in a specific situation. It determines how much resources are used and how much product/system is scalable, reliable, responsible, and speedy during test. This testing does not give pass or fail result, used to set the benchmark & standard of the application/system against Concurrency/Throughput, Server response time, Latency, Render response time etc. This testing is the subset of performance engineering and it is used to determine the performance issues come in the design and architecture of software product. It is very extensive, contains: Load Testing, Stress Testing, capacity testing, volume testing, endurance testing, spike testing, scalability testing and reliability testing etc.
For example; to know the web application is working fine or not, we need to test two things,
- Load in terms of concurrent users or HTTP connections
- Suitable response time
Constantly, increase the load on the system while looking for bottlenecks. For a web application, these bottlenecks can occur at multiple levels, and to locate them you can use a various tools,
- At the application level: Profilers can be used by developer to spot inefficiencies in their code.
- At the database level: Database-specific profilers and query optimizers can be used by developers and DBAs.
- At the operating system level: Use utilities “top, vmstat, iostat” on Unix-type systems and “PerfMon” on Windows to monitor hardware resources such as CPU, memory, swap, disk I/O.
- At the network level: Packet sniffers “tcpdump”, network protocol analyzers “ethereal”, and various utilities “netstat, MRTG, ntop, mii-tool” can be used by network engineers.
The activities described above will use a white-box testing approach, where the system is examined and watched “from the inside out” and from various angles. The Jmeter tool is good tool to execute performance testing. (Get Full JMeter Tutorials Training series here)
Primary aim of Performance Testing:
The primary aim of performance testing is to determine the benchmark behavior of a system under test. During test, performance testing benchmarks should meet with the industry-defined benchmarks.
Performance testing aim is not to find bugs of the system/application, its aim is to set and test the benchmark of the application. Correctness and close observance of the performance and results of the application during test is the primary characteristic of performance testing.
We have already seen above that load testing is an important part of performance testing. In case of Load testing, we can continuously and steadily increase the load on the system till the time it reaches the threshold limit. Very easily we can test the load of the system by using automation tools like; LoadRunner or any other suitable tool. Load testing is also well-known by the names like volume testing and endurance testing. In the above example, for a web application, the load is defined in terms of concurrent users or HTTP connections.
Examples of volume testing,
- Test of a word processor by changing large volume of data
- Test a printer by transferring heavy data
- Test a mail server with 1000 of concurrent users
Examples of endurance testing,
- Test a client-server application by running the client in a loop against the server over an extended period of time
Here we can see, performance testing and load testing looks similar, but their goals are different from each other. In some cases, load testing has been used with performance testing for measurement and bench-marking. And in some cases, load testing works at a predefined load level, usually the highest load that the system accepts.
Aim of Load Testing:
Find out bugs that are not possible with any other such as memory management bugs, memory leaks, buffer overflows, etc.
Make sure that the application meets the performance point recognized during performance testing. It is possible due to regression testing against the application at a specified maximum load.
During test, Stress testing tries to break the system by crushing or hiding its resources (sometime we called this a negative testing). The purpose of it to ensure that the system fails and recovers gracefully (sometime it is called as recoverability).
In the above example of a Web application, the stress can be applied in various,ways:
- Double the baseline number for concurrent users/HTTP connections
- Randomly shut down and restart ports on the network switches/routers that connect the servers (via SNMP commands for example)
- Restart the offline database
- Rebuild a RAID array during run time of the system
- Run method that includes resources (CPU, memory, disk, network) on the Web and database servers
Aim of the Stress Testing:
The aim of the stress testing is to examine post-crash reports to express the performance of application after failure. The major subject is to make sure that the system does not cooperate with the security of complex data after the failure. In a effective stress testing, the system will come back to normality along with all its components, after even the most terrible break down.