Modular Test Design with CloudTest

Before joining SOASTA, much of my career as a performance engineer was focused on testing large-scale web service applications. While each application was different, two things remained constant:

  1. There is a very large and diverse set of data flows into and out of the application.
  2. The vast majority of API calls into the system required data returned as a response from other service methods.

This can present a difficult challenge when planning and constructing accurate and repeatable load profiles and stress tests. For one thing, how do you construct tests to emulate all of those flows? And when a call changes, but exists in multiple scenarios, how do you quickly and easily update your tests to include those changes?

Let’s imagine just a small web application that serves as an authentication service and data repository for an online retail site. Our imaginary services will handle validation of user credentials, management of sessions, and provide product information and shopping cart services for items being sold.

Creating a suite of tests for an application like this is pretty straightforward: you create a set of scripts that perform each flow you would like to test. One script may log on, browse through some products or categories, and log out. Another will browse to a product and then follow steps to purchase the item. And a third might log on to the site and browse for a while before abandoning the site without making a purchase.

What happens when our imaginary company starts providing services for external partners and the login operation now requires an additional parameter declaring the origin site for the user who’s logging in? In our imaginary web service, it’s not too difficult; we only have a few scenarios where the login operation must be altered to accommodate the changes. What if, however, our scenario is designed to test a large-scale multi-path application? Using other tools, one may be required to manually edit dozens of scripts that reference the method that has been modified. This maintenance task can quickly become cumbersome and time-consuming.

The CloudTest® platform’s drag and drop composition interface makes the maintenance process easy by allowing you to break your tests down into smaller components.

In the example shown above, we have a simple test scenario (in CloudTest this is called a Composition) for our imaginary company. As you can see, the complete flow has been broken into smaller components placed in order on a track. Our first track will emulate a user logging in to our site, browsing through items, and selecting an item to add to the user’s shopping cart. The second track opts for logging out of the site after browsing. Data is passed from clip to clip with the use of track properties, which function identical to properties at the clip level, but within the scope of an entire track. (For more information on properties visit Cloudlink.) Clips can read, write and modify property values created by the clips located before them in the timeline. This enables very easy data exchange between the sub-components of the test.

Let’s take a look at our BrowseProductCategories test clip, specifically the browseProducts request:

As you can see, we have a simple web service call, which we manipulate via an intuitive form interface, with no need to manipulate and manage complex XML data or name/value pairs. This service call uses a sessionId variable stored in a track property. The value of sessionId comes from the response of the createNewSession call, which executed earlier in the timeline. We’re also referencing a clip property, which contains a random category ID.  This call will return a list of all available products in the selected category, which we can then use to create a property that stores this list of products to be used later by any clips that may need them (like the AddItemToCart clip).

This modular approach to test design provides some terrific benefits.

First and foremost is maintenance. As was mentioned earlier, if there is a fundamental change to the way a user authenticates, we will only need to change a single clip (in this case the createNewSession clip). The changes will immediately take effect in all of our scenarios, saving us significant time in updating all of our test cases. Another great benefit of this type construction is the ability to quickly modify the flow a user takes through the application, or add an entirely new flow to the composition, simply drag and drop your clips into the right places.

Additionally, since each operation is isolated in individual clips, we are able to use the clip repeat functionality to quickly change the behavior of the track without making any permanent or significant changes to any of our components. See the example below.

In this case, we’ve added five clip repeats to the second clip in the track, BrowseProductCategories. Now when this test is executed, this user will browse through five categories before adding an item to their cart.

Prior to SOASTA I worked on the flagship product for a major media corporation, maintaining more than 150 different possible data paths, many of which were continuously undergoing major overhauls. This test design and unique interface saved me countless hours by cutting down on the tedious maintenance and gave me the ability to make fundamental changes to multiple test paths in minutes, not hours. In turn, this gave me the freedom to better use my time to expand test coverage in areas that were lacking. While my test scenarios and application coverage grew more robust, the time required to modify and maintain my test suite remained consistently low.

Take a moment and consider where this type of testing approach might apply to your current or future tests; it may end up saving you significant time in test maintenance and construction. If you have implemented tests like this already, we’d love to hear about it, leave us a comment and tell us your story.

 

Don’t Neglect Your Mobile Customers

Errors that only your mobile or tablet customers may see

Every day, more and more of your customers move off their standard desktop computers in favor of smaller and lighter alternatives. Today, many people do much of their day-to-day Internet activities exclusively on their smartphones and tablets. One can no longer assume that the majority of traffic coming to your web application will come from the traditional desktop computer; this is especially relevant for e-commerce sites.

According to data collected by Digby, this holiday season, more than ten percent of Cyber Monday shoppers used their mobile devices to make a purchase, and total mobile purchases accounted for more than 6.5% of all sales made by consumers. Both of these statistics are up significantly from last year, and the growth shows no signs of slowing down. In fact, 67% of consumers reportedly plan to make at least one purchase from a mobile device this year. As this trend continues, considerations must be made for how companies plan and structure their applications, as well the implications on performance and functional testing needs.

Recently, SOASTA was involved in a project for a major retailer preparing to launch a new and highly anticipated product. This retailer estimated that 30% of the launch-time traffic would originate from smartphones and tablets. Because of the unique recording technology built into CloudTest, we were able to construct a test that ultimately exposed several bottlenecks in the mobile order paths, which were not present in the standard desktop browser flows.

Under load, both the tablet and smartphone paths showed a significant number of errors when adding products to a shopping cart:

In the chart above, not only do we see a large amount of HTTP 500 Internal Errors (which occurred whenever the response time for a request exceeded 10 seconds), but there are also a substantial amount of asset requests that return ‘Not found’ during the test (an asset which happened to be vital to the completion of an order). Every one of these errors represented a sale that did not complete. In just 15 minutes, more than 7,000 orders failed due to these errors. To make matters worse, the results described above were produced by a test that was configured to run at only 10% of the volume and concurrent connections expected when the new product launched!

As a result of this test, the customer discovered a problem with their application code that caused these errors and changed it prior to launch.

Errors are bad enough, but what about response times?

This particular test exposed some critical scalability issues that only showed up under load – and only showed up on mobile and tablet devices. Unfortunately for our customer, it wasn’t the only issue observed during this test. Certain page and transaction times were extremely high as well – as shown in the chart below.

Here we see the response times per transaction experienced by mobile users, again at 10% anticipated launch traffic. The final step in the user experience (and in this case, arguably the most important: when the user’s payment is processed) had an average time to complete of more than 30 seconds on the mobile and tablet sites! This is in contrast to the desktop browser test scenarios which showed virtually no slowdown or issues. This helped the customer isolate a specific database contention issue that was unique to the mobile and tablet flows.

Mobile Implications

Fortunately, these issues were detected early, which allowed our customer the ability to address them. If these issues weren’t resolved, a failure of their site would have had a substantial impact on revenue.

Keep in mind, however, that your visitors are utilizing your site for more than direct purchases; they’re also looking for promotions, product descriptions, and locations or directions to brick and mortar stores. This type of usage requires additional design considerations for the layout of your site’s pages. Besides the obvious considerations for the physical differences of the device itself (screen size, touch screen input, etc.) we must also consider bandwidth availability and transfer speeds of mobile devices, and keep those constraints in mind when executing our tests and analyzing results.

Because mobile devices typically take longer to complete a transaction (especially on 3G and Edge networks), the resulting connections from those devices are kept open longer. This has the potential to increase the total number of active connections when user traffic is high. Failure to tune your application and network to properly handle these longer connections may result in missed opportunities. Even if the application servers have ample system resources to handle more traffic, potential customers will be unable to access the application because of insufficient connection availability.

Whether it’s a mobile site or a mobile application, SOASTA CloudTest is able to record directly from mobile devices, allowing anyone to create robust test scenarios without the guesswork involved with user-agent spoofing or other artificial means of deceiving your servers. CloudTest provides the analysis tools required to determine what users would experience when they visit your site, regardless of where they are and what type of device they are using.

Email Us!
Subscribe to our Feed!
Join us on LinkedIn
Find us on Facebook
Follow our Tweets
See our pics