Web Testing: a critical step in web application development

SoftLogicaWe all want our web sites to work well and to make a good impression upon visitors. What can we do to be sure that we provide an excellent web site performance without any unpleasant surprises? The only solution here is to perform web tests where test volume and characteristics of expected traffic are simulated as realistically as possible.

In this article we will explain the importance of web testing and the advantages you get using it. Also we’ll look more carefully on three main types of web tests according to the tasks they perform.

Business view on web testing

Web site response time should be less than 10 seconds. This is shown by the following graph, taken from the “Load time – the three important limits” article by Jakob Nielsen:


Poor performance on the Internet leads to dissatisfied users, and dissatisfied users may leave a web site and never return again. Thus, load testing implemented beforehand and corresponding measures taken to make you response time less than 10 seconds can prevent these losses.

Company expenditures on a Web site’s support should be adequate to site’s expected traffic. Ideally, you want to spend enough, and no more, allocating resources where they’ll generate the most benefit. For example, you don’t need to upgrade your Web servers if customers experience most delays in the database server or in some scripts. Thus, to maximize your ROI, you should determine when and how to upgrade IT infrastructure. Web testing can measure performance of your web system and its components allowing you to invest with maximum effectiveness.

Technical view on web testing

Complete web testing of a system before going live is the primary step to get assured of an entire web application’s ability to work properly. It can help address such issues like readiness of your web server for the traffic you are expecting and for the increasing number of users, the ability to survive a massive spike in user traffic, your server hardware sufficiency and so on. After performing web tests you’ll be able to find bottlenecks in your systems before they happen in a production environment.

Neglecting performance problems can lead not only to poor end-user experience, but even application crashes. Many bugs can only be found when the system is placed under load. You won’t be able to discover these bugs by testing the system as a single user during the development process. That is why testing of web systems under load is really important.

Performance, load and stress testing – what’s the difference?

  • Performance testing is the process of identifying how an application responds to a specified set of conditions.
  • Load testing is a type of testing where realistic (or hyper-realistic) workloads are specified and simulated. The load testing goal is to determine the maximum time (from a usability and customer experience standpoint, not a technical one) it should take for all page elements to load.
  • The goal of stress testing is to estimate the maximum load that your web server can support. The point is that most performance issues arise only when the server is stressed with a high user load, because many important bugs simply do not surface unless you deal with very large entities such as thousands of users, thousands of mail server mailboxes, multi-gigabyte tables in databases, deep file/directory hierarchies on file systems, etc.
  Performance Testing Load Testing Stress Testing
Purpose You do performance testing in order to find any bottlenecks in your web-application code and eliminate them. You do load testing in order to verify that your application can meet your desired performance objectives with a comfort for the users. You do stress testing in order to observe how the system reacts to failure and how to improve it.
How it
works?
Performance tests verify each part of the web server or the web application to discover how to optimize them. Most often this is done by testing various implementations of single web pages/scripts to check what version of the code is the fastest. All the activities take a white-box approach – the system is inspected and monitored “from the inside out” and from a variety of angles. Load testing uses the best estimate of the traffic your website needs to support to guarantee that the maximum number of users will see your web pages and feel comfortable with your site. This is done by running regression tests against the system at a maximum load. Stress tests simulate “brute force” attacks that apply excessive load to your Web server. “Real world” situations like this can be created by a massive spike of users – caused by a large referrer (imagine your website being mentioned on national TV…).
When to
perform?
The best time to execute performance testing is at the earliest opportunity. Performance test at an early stage provides opportunity to prevent serious performance problems and to find bottlenecks before load testing. Run load testing just after your eliminated the bottlenecks in your code (after performance testing). It is recommended that a stress test is performed after a load test phase.

Web testing software – how does it work?

There is a wide range of web testing software which have different features and, of course, different price. Choosing a tool most suitable for one’s business often becomes rather difficult. You should consider what you need exactly to spend your money most effectively. When choosing a web testing tool you’d better try to find one that simulates real load conditions more effective than others do. This approach is much more efficient than producing stress test by sending many identical requests to the server. Usually it’s performed by simulating many different users coming from different IP addresses, each with their own parameters: cookies, input data for various page forms, name and password, connection speed and their own specific path through the site. Let’s take a closer look at some features of web testing tools.

Virtual users and profiles

Web testing software emulates the activity of human users with the help of virtual users. Each virtual user emulates the actions of a single real user. A test run can contain hundreds or even thousands of virtual users to let you emulate the load experienced by a web site when the corresponding number of real users browse it. User profiles describe the behavior of virtual users. This allows to emulate a real workload on a tested server. A workload (or test volume) is the total amount of activity placed on the tested web application. It consists of a certain number of virtual users who process a defined set of transactions in a specified time period. For each user profile, you should specify web pages that will be requested (visited). It can be easily done with the help of recording tool.

Recording tool

Usually web testing software lets you create profiles for virtual users by recording your own actions when you browse the web site. You should perform all the steps of the virtual user for which you create the profile. The system then reproduces these steps during test run. All you have to do is to make some requests by clicking on necessary links like you do when surfing web pages in your browser. You can use this scenario later as many times as you want.

Flexible load level definition

You can either choose a constant load level for the whole test time, or increase the load after the specified time intervals during the test, or periodically increase/decrease the number of users by introducing 2 phases changing one another: one with a low load level and another with a high load level. You also specify the duration of test run and the number of virtual users for each profile. Overall load significantly depends on the type of users, so you can change it by introducing new types of users making them “slow” or “fast”.

Test reports and graphs

Summary reports and graphs are useful to determine the presence of any problems in the overall performance. It’s better to choose a web testing tool that provides you with the highest level of detail in report. When using a good web testing application you can check through more detailed reports down to the level of separate user profiles and pages to find specific bottlenecks. All reports are usually created in HTML format, so you can easily share them with your colleagues. Some tools also support saving test results in MS Excel compatible format.

Conclusions

Web testing software gives you an assurance of reliability and stable work of your web sites or applications. Of course, you always can neglect purchasing testing software and hope that everything would be ok. But in that case nobody guarantees that one day your web site won’t crash. So, web testing tool is a worthy purchase, isn’t it?

Web Stress Testing