It was a delightfully warm afternoon and our golf foursome had reached the tee box for the 8th hole. I had been struggling the entire round to hit a straight tee shot with my driver club. I asked the individual in the cart with me if there is a direct correlation between the way I hold the club and the errant tee shots that have clobbered my score.
His response was “Of course” and as he talked away he mumbled under his breath “that correlation I understand, if only someone could explain to me the correlation that I have to work so hard to find and put in place for those darn load tests at work”.
I immediately knew exactly what he was referring to. I have worked for a number of years to gain a thorough and comprehensive understating of the ‘correlation’ process as it applies to load testing. It all comes together when you finally realize all of the tasks that must come together to make the process happen.
At its’ base, Correlation is the method by which dynamically generated session values, that are created by the server and sent to the browser, can be identified, captured and used where required in the load testing script. How this is done within the load testing toolsets is what sets them apart. Load testing does not work without correlation and thus all of the toolsets are required to address this process.
The first challenge is identifying which dynamically generated session values are the ones that require correlation in order to use the value applicable to the current web session. Seasoned load testing professionals have a pretty good idea. The good news is once you identify the values for a specific application, they don’t change much, if at all. It is the first time thru a new application that imposes the vigilant search for values that will cause the script to fail if they are not correlated correctly.
Once the required values are identified, the correlation for each of them needs to be written into the script.
The key is to determine everywhere in the script that the captured dynamic value is used and replace with the variable that was created. A find and replace will generally handle the task, however there could be exceptions where the value actually changes during the script and would require additional code to ensure the correct value is captured and used.
Most of the open-source load testing tools depend on the user to manually identify, create and apply the required correlation. This is great if the individual creating the load session script is a competent programmer, even then the process can be difficult and tedious. If not, then manual correlation of a load session script can be a daunting challenge.
Some of the toolsets will do bits and pieces of the correlation in an automated fashion. For instance, I saw a video recently of one toolset that requires the user to identify the values that need to be correlated, manually locate where that value was sent to the browser by the server in order to manually specify the text preceding the value and the text that follows the value. Once all of the manual effort is complete, the toolset then will do an automated Find/Replace to put the newly created variable into the script in place of the locations where the value was recorded. It replaces them all, whether needed or not.
WebLOAD, from Radview, has a correlation engine that reviews all of the requests/responses that were sent between the browser and the server. It identifies values that would appear to be candidates for correlation based upon their 20 plus years of correlation experience and extensive heuristics driven by an uncountable number of real life scenarios. WebLOAD then presents the user with a list of those items and allows them to select the values that are known to require correlation. If this is the first time that the application has been recorded, the user can select all of the recommended correlations. During the test phase, WebLOAD will indicate if a value did not change from the recording, meaning that the correlation is not necessary and can be removed from the script. This takes all of the guess work out of the correlation identification process. Last but not least, if the value being correlated is one that will always need to be correlated for this application, WebLOAD allows you to create a permanent Correlation Rule so that the identification of values for that application will no longer be necessary, unless the programmers make changes that create new requirements.
While my golf game was nothing to brag about, I did have the opportunity to share this information with my golf partner and it seemed as though I was able to lift some of the fog that was clouding his vision and understanding of the process for dynamically generating session values. I am confident that he will get better at it over time.