Performance Tuning - Chapter 5: Testing

This chapter focuses on performance tests as a benchmark that measures the optimization strength of an application and determines the extent to which an effort should be put into further optimization. Here are some general rules of how to develop such a test:

1. Define a minimal target configuration up front

Define test cases for specific parts of the application. Do not just define one test case for the whole project. This helps to easily target which parts of the application need to be improved most.

2. Stress test from the start

This means that you should test for performance from day one. Do not wait until very late in the project. Stress test is more related to the quality of the performance than to the speed of the performance. In a real project, problems will show up under stress. Also it is worth mentioning that a stress test needs to be done for multiple browsers; just one is not enough.

3. Integrate and test performance continuously

It would be a nice habit to produce test cases and integrate testing with development of the application code from the beginning until the end of the project. Sometimes people focus more on functional testing and ignore performance testing. It is not wise to do that, because performance issues will become more difficult to target and correct in later stages of the project.

Example

As an interpretation speed test, simple JavaScript time-recording code can be added to record the time that the Backbase Client Runtime engine needs to interpret and generate model nodes or controllers:

<script type="text/javascript">window.startDate = new Date(); </script>
<script type="text/backbase+xml" e:onload="document.title = new Date() – window.startDate"></script>

To test the loading time of certain parts of the application, here is an example below:
//function start
bb.console.time()

//function content

//function end, print out the function elapse time
bb.console.timeEnd();

As a loading speed test, Firebug can be used to detect the number of HTTP requests and the loading times, both for source code and for media resources. Always test loading speed in a standalone way to remove the effect of network latency. Also, the test should be run in different environments, i.e. on different kinds of computers and on different operating systems.

See other chapters:

Performance Tuning - Checklist

Performance Tuning - Chapter 1: Architecture and Design

Performance Tuning - Chapter 2: Implementation

Performance Tuning - Chapter 3: Deployment

Performance Tuning - Chapter 4: Server-side Optimization

Performance Tuning - Chapter 5: Testing

Performance Tuning - Chapter 6: Conclusion