What is Scalability Testing?
Scalability Testing for an application is carried out where there is a prediction or plan for future up scaling or down scaling. When the software is passed through this type of testing, it is usually to observe the options for increasing or decreasing certain system features, like the volume of data, performance of the system, number of processes complete at a given time, number of users using the system at a given interval of time, etc.
In the real world, it is very important to test the scalability of the system before it is released in the Production environment. Consider a scenario of e-commerce shopping website and the website is working fine on normal days but at the time of sale or any special occasion, load/traffic on the website increased by 2-3 times and the website starts responding very slow or crashes at some point. It will cause huge loss of money and reputation in the market. Applications must be able to cope with the different scenarios of a large number of user requests, data volume, and other workloads. Scalability testing ensures the developers that the application is ready to be released and available to the customers.
Many people use the terms Scalability testing and Load Testing interchangeably but there is a lot of difference between the above two. Though both are non-functional testing load testing is performed to check at which point on applying a maximum load an application would break but Scalability Testing is performed to test the behavior of various attributes of an application on applying various loads from minimum to maximum. Its main objective is to test the performance of an application under various loads rather than testing the point of response failure of an application.
How Scalability Testing is Performed?
As discussed above, Scalability testing is done to check the performance of an application at different workloads. In order to perform Scalability testing, the following steps are followed by using any scalability testing tool available in the market.
- The first step is to define a repeatable process that runs throughout the application lifecycle.
- Searching any suitable software/ tool for testing the application.
- Creating a good testing environment that is almost a replica of the production environment where the whole testing is performed.
- Configure the hardware required to perform scalability testing.
- Creating multiple virtual users in the form of threads to perform testing under various loads.
- Create various test scenarios considering different test conditions.
- Run the test scenarios in the test environment created above.
- Evaluate the results and observe the different graphs and charts generated for each scenario.
- Take the corrective measures according to the results found of the above scenarios to enhance the performance of an application.
Scalability Testing Tools
The tool used for scalability testing depends on the application the user wants to test. Though there are a lot of scalability testing tools available in the market and that too open source. Some of the tools are mentioned below:
- LoadUI Pro
- Apache Jmeter
- Load View
- Neo Load
- Load Impact
There is no classification of best and worst tools available in the market for Scalability testing. Every tool provides its own special features to test the scalability of an application but every organization has certain criteria and environmental factors of an application also affect while choosing any tool to test an application. Testers need a test tool which can handle load factor under various scenarios created.
Scalability Testing Attributes
Below given are some of the common attributes of Scalability testing:
Throughput is defined as a number of requests processed per unit time. However, for different applications, the definition of throughput may vary and is tested in a different way. For example, for a web application, throughput is tested by verifying the number of user-requested processed in a unit time whereas, in case of a database, throughput is measured by the number of queries processed at a time.
2) Memory Usage
Memory Usage is also tested in order to get the best results of memory consumption for an application. In Memory Usage, the amount of memory used on performing any task in an application is tested. Because on performing any task, a memory of RAM is used which should be optimized for the smooth running of any application. For less use of memory, good programming practices should be followed by programmers like less use of redundant loops, reduce hits to a database, handling maximum validations at the client-side only, etc. Many times, an application runs out of memory due to a large number of requests, so developers should always keep extra database to handle such situations.
3) CPU Usage
CPU Usage is tested to check the CPU utilized on performing any task in an application. CPU Usage is measured in MegaHertz. For less CPU Usage and more throughput, the code of any web application written in any programming language should be properly optimized. Avoiding the programming practices like dead and redundant code, Threads, unnecessary loops should be avoided by developers to reduce CPU Utilization. Sleep is the best method that should be used to minimize the usage of CPU in between.
4) Network Usage
In-Network Usage, the amount of bandwidth consumed in performing a particular task in an application is tested. Network Usage is measured by the bytes, segments, packets received or sent per second over the network. For an ideal application to give the best results, network usage should be minimum. Various congestion techniques are used by the programmers to reduce the network consumption and high performance of an application.
5) Response Time
It is one of the most important attributes in Scalability testing. Response time is basically the time between the user request and response from the application server. Response time is tested at various loads either by increasing the number of requests per user or increasing the number of users to verify that at what point of time application will start responding late. In a clustered environment, a load balancer is used to check the load on various nodes so that it may not be the case that one node is overloaded with the request and another node is idle waiting for the request resulting in larger response time. For a scalable application, response time should be minimum even on increasing the traffic. Lower the response time. Higher the performance of the application.
6) Time is taken to Load a Web Page of Website
Time is taken by a particular webpage to load in an application also matters a lot and affects the overall performance of a website. For any web page to load fast, programmers are advised to use the good programming practices and use the lightweight tools, images, videos, etc that can load easily and quickly.
Approaches of Scalability Testing
There are two approaches to Scalability testing:
1) Horizontal Scaling
Horizontal Scaling involves adding more physical machines and resources and hence reducing the load on each machine/ resource. This process involves increasing the number of nodes instead of increasing the capacity, load is divided between the old and newly added resources. Horizontal scaling is referred to as scaling Out as the scaling is done in the outwards direction by increasing the resources.
Horizontal Scaling is done by big companies like Google, Yahoo, Facebook, Amazon, etc having very large projects/ applications running in a multi-node, distributed environment. It requires a high level of computing and can be achieved using clustered, load-balancing and distributed file systems. Horizontal scaling involves partitioning of data, i.e. data is divided between different nodes. although the capacity of a single node remains the same and is not decreased, but the load is divided between different nodes and hence the overall performance is improved under different loads. Though theoretically, it is easier to do horizontal scaling by adding the resources in the existing pool but practically, it is very difficult to Scale-Out the application.
2) Vertical Scaling
Vertical Scaling involves increasing the power of already existing machines either in CPU, RAM, Disk to the server. It can be adding more CPUs to the same single server. For example, before when the work is handled by 1 CPU, due to an increase in load, the performance of the system starts degrading, for this in spite of using 1 CPU, the number of CPUs has been increased in the single server. If the requirement of memory is increased from 4GB to 16 GB to maintain the good performance of the system or the disk size is increased from the existing size, vertical scaling is done.
Vertical scaling is done generally by small or mid-sized companies for the small applications where the performance can be maintained of increasing load just by increasing the capacity and size of already used resources. In vertical scaling, data resides on a single node at one place and the load is divided between the different CPUs and memory through multi-node. Vertical Scaling is comparatively difficult and is limited to a particular capacity of a machine or server. MySQL is a good example of Vertical scaling and can be achieved on switching from small to much larger machines.
Advantages and Disadvantages of Scalability Testing
Following are the advantages and disadvantages:
Below given are some of the advantages of Scalability testing:
- One of the most important advantages of Scalability testing is that it determines the end-user experience under the specific load so that corrective measures can be taken in advance to rectify the problems and make the application more scalable.
- It helps to determine the limitations of the web application under test in terms of either Response time, Network Usage, CPU Usage, etc.
- To reduce the risk of huge loss of money and the company’s reputation because of the bad performance of an application, it is very important to do rigorous Scalability testing before releasing it in a production environment.
- It uncovers the exact cause of various performance issues in an application in the testing phase only which saves a lot of time and money if detected in the production environment.
- Scalability testing also helps in effective tool utilization tracking.
Some of the disadvantages of Scalability testing are:
- The testing environment is not always exactly the same as a Production environment and hence can result in various issues and different results.
- The use of advanced tools for Scalability testing and a specified testing team for performance testing can lead to over budget of the projects.
- Time spent on testing every single attribute of Scalability testing is sometimes very high and can cause a delay in meeting the deadlines of the project.
- Sometimes tests that are actually working fine, gets failed in the testing phase due to wrong test scenarios and test scripts cause a waste of time in making unnecessary changes.
- Sometimes, functional errors are left behind and cannot be identified in Scalability testing.
- At times, the test window offered is very narrow in order not to disrupt business processes and hence the defects remain uncovered.
In the software industry, it is very important to deliver the quality results to the client and for best results and performance, scalability testing is a must for the complete development of an application before it is released in the production environment. The main objective of Scalability testing is to find when an application starts degrading on applying different workloads in order to take preventive measures and make changes so that the risk of loss of money and market reputation can be reduced. Though method and tool used for scalability testing differ from organization to organization and from application to application.
Now almost all the companies have added Scalability testing as a part of their testing process. Scalability testing requires a separate team of professionals and tester who have complete knowledge of the system and have strong analytical skills. There is a high demand for people in the market for Scalability testing and companies are ready to offer handsome packages to professionals.
This is a guide to Scalability Testing. Here we discuss Scalability Testing Attributes, Tools and Approaches of Scalability Testing along with Advantages and Disadvantages of Scalability Testing. You may also look at the following articles to learn more –