Where do I start? What am I doing? (Why am I even here?) Have you ever asked yourself these questions at the beginning of a performance testing project? Have you been one of the many test engineers who have been delivered an application and told to “just test it”? (True story: I was once handed off an application to lead a performance testing project on with these words of guidance, “Just test it to make sure it doesn’t suck”). If you are one of the fortunate performance test engineers who have a well-defined process in place in your organization that dictates what are you testing, what you are looking for, etc., then this discussion might not be for you. But for the rest of us, those of us that might need a little guidance in starting our project, read on……

What Are We Testing? What Are We Testing For?

I don’t believe there is any one right way to approach a load testing project. And while there may be several different methodologies, I think ultimately they all take us in the direction of identifying a similar starting point. And while my discussion here certainly will not include every detail one should consider, my goal is to provide you with some ideas and practices to get you on your way.

Before we can begin any kind of testing project, we need a game plan. We need to know what we will test and what determines a successful test. We need to determine whether the application we’re testing is “good” or “bad”. It’s common to think that only functional tests have pass or fail conditions but load tests should usually also have criteria defined to dictate whether the application’s performance passes or fails.

Essentially what we’re talking about here is coming up with the best approach to develop a load/performance testing Test Plan…or at least the “goals” part of a test plan. (A good test plan should include a lot of additional information – schedules, roles of team members, tools to be used, etc. – that I won’t discuss here). The key is determining how we’re supposed to approach this application-to-test that was just presented to us.

This game plan should be comprised of three pieces. One, what is the activity that the end users of the application do? (What are our use-cases?) Two, how many of these users are there doing whatever they do? (What is our workload, e.g. concurrency and/or transaction rate?) And finally, how fast do we need the application to allow these users to whatever they do? (What are our performance requirements)? Let’s take each one of these at a time.

Identify Use Cases

Now that I have this new application in my hands, how can I determine what a user is supposed to do with it? The best approach to answer this question is usually simply to ask someone. Ah, but who to ask? Ideally, a good start would be to find someone involved in developing product requirements. At some point someone had a thought, “We should build an application so that users can do something”. Identifying who that person was and what that “something” is, is the key.

I typically like to start with someone in product marketing or product management – someone who has done the work to create the user scenarios that the development team has implemented. If you’re lucky, you might be able to find a Marketing (or Product) Requirements Document that has this information documented. Otherwise, a conversation with someone in that department might prove very useful.

If this information is not documented anywhere (gasp!) and the application is one that is currently in production, there will probably be some useful information in the log files captured in the application’s infrastructure. Ask your web or application server administrative team if this is information they capture. They may use tools like Omniture, Coremetrics, Web Trends or Google Analytics that can help provide this. If they don’t, it’s usually possible to turn on some sort of logging for a period of time (a day or two perhaps) so that tracing user activity can be captured. In addition, getting access to actual end-users could be very helpful. As a performance engineer, it’s probably not feasible that you have contact with the user community but this is a conversation you might be able to start with another internal resource – customer or technical support teams, sales representative, or (again) marketing folks.

Finally, common sense is an approach that can be very useful. (As obvious as this may seem, I’m constantly surprised by the number of times “common sense” is overlooked). Take a look at the application itself and decide what it is that YOU might do if you were an end-user. If you’re testing an online store type of application, it’s a pretty good bet that users are going to browse through the product catalog, add items to a shopping cart and make a purchase or two. Online banking customers are probably checking their balance and paying bills… you get the idea.

Generally speaking, you should not waste time trying to identify every single use case through the application since the bulk of user traffic will be captured in only a few transactions. Keep in mind the famous “80/20 rule”; that is 20% of the transactions cover 80% of application’s core functionality.

Calculate Workload

So now you’ve got a start on identifying the first piece of the load test project puzzle; the use cases to be modeled in your load testing processes and/or load testing tool. Next we need to identify the actual workload that will be used in our load testing – that is, how many simultaneous users that will be sending network traffic against the application we’re testing.

The best process to find out this information follows that of identifying the use-cases that we discussed earlier – again, try talking to someone “in the know”. The application’s specification documents should detail the expected user load or expected transaction rates. If they don’t and you are to test an application which is already in production, working with the administrators of the applications architecture can again be helpful. They should be able to give you a sense of what sort of user load the application has experienced. When looking at this data, be sure to use a wide enough data sample to find the peak load the application has seen.

If this is an application that is not in use yet, many of the same principles we discussed in determining use cases apply; talk to marketing people, determine what the expected loads are. Even if you are conducting tests due some expected increased load in the application; a sale or promotion, an expected seasonal rush, rolling out an internal application to a new set of employees, etc., the hope is the expectation of load has been documented somewhere.

You may also be able to determine the number of users to test for by using a formula known as “Little’s Law”. This formula is only really applicable if you have either determined baseline throughput (transactions per second) and transaction response times or if you have desired requirements for both. But if you do have this information, using this formula is a great way to figure out how many users to test for:

  • Number of Users = Response Time * Transactions/second

There are many articles on the web about Little’s Law and the different ways it can be applied. If you have access to the “inputs” of this formula, I’d recommend doing some extra research and seeing how it might be of use to you.

Generally speaking, once I determine the peak usage load my application will handle (or hope to handle) in production, I will conduct load tests scaling to 110% of that number.

Establish Performance Requirements

So now we know how to find what use cases to model and how many concurrent users to test for. Now what? Surely we can start to execute some load and performance tests, no? Well yes we can. However, it seems that we still don’t know what we are testing for. I.e. why are we even conducting this project?

This is where developing good requirements come in. As I mentioned earlier, we need to figure out just what we’re looking for as the results of our testing. To me, test requirements fall into two high-level buckets: Baseline/Benchmark or Performance Requirements.

A Baseline or Benchmark test doesn’t usually have any detailed pass or fail criteria. Instead it allows you to provide results that state, “under these circumstances, the application performed like this”. Benchmark tests can of course be very useful for examining the impact of infrastructure changes. Conduct an initial baseline test, modify the infrastructure, run the exact test again and compare the “before” and “after” results. The results of your initial baseline test can always serve as a performance benchmark.

Performance requirements on the other hand can help us determined whether the application is ready to be delivered to production.

What just is a performance requirement? As I’ve indicated, this essentially is the indicator of whether your performance test passed or failed. It may be response time-based (e.g. the Login transaction must always be faster than 3 seconds), it may be load-based (e.g. the website must be able to withstand 1000 concurrent users, how many concurrent users will my site handle before it crashes), it may be transaction rate based (e.g. the application must be able to handle 100 orders per minute) or it may be combinations of all of the above. Requirements may also include details on how the back-end infrastructure behaves (e.g. CPU utilization on the database server may never exceed 50%). If the end-goal of our testing is to make a “go” or “no go” decision on system, the more detailed our performance requirements are, the better.

How can I determine performance requirements? Maybe not surprisingly, the source(s) for this information should be very much the same as what we discussed for determining use cases and user concurrency. The various stakeholders (product management, marketing, business analysts, etc.) hopefully have this information documented somewhere. There may be contractual Service Level Agreements in place between your company and a customer, or between teams within your organization. Hunt them down (both the other teams and the SLAs). Or this information might just be stuffed in the back recesses of some stakeholder’s brain. As you might have guessed by now, one of the things I hope to have achieved with this article is facilitated communications between the performance test teams and other groups in the organization – something I notice isn’t happening in far too many companies.

And similar to what we’ve discussed earlier, if performance requirements are not easily available and you’re hoping to test beyond a baseline, use common sense. What do YOU think is an acceptable wait time before a web page returns?

There are many studies you can find on the internet which discuss acceptable wait times but I’m not sure these are always valid. Plus they seem to change too quickly. It wasn’t too long ago that an 8-second response time was the “cut-off” point between good and bad response time. Waiting 8 seconds now seems excessively long… except perhaps if you are using a mobile device. But my point is that it’s all subjective and you should determine requirements specific to YOUR application and YOUR user community.

I may not have provided all the answers to the “where do I start?” question here. But hopefully this discussion has given you some clues as to the information you should gather before you begin your load testing project. Ideally you will now have a better sense of where to get some of this information and what some of the thought processes are to fill in any missing pieces on your own.

, ,

One Response to ““Just Make Sure it Doesn’t Suck”: Good Application Testing Despite Vague Requirements”

  1. Quora says:

    What are the main challenges of load testing?

    Satyajit makes an excellent point that’s too often overlooked: defining the correct process and strategy is as important (if not more so) than selecting the correct tool. Defining proper requirements should be a mandatory part of the conversation (and…

Leave a Reply