Data correlation adjustment guidelines

Automated data correlations sometimes require manual adjustments, and complex manual correlations sometimes require a detailed understanding of how the tested application is implemented.

When you run a test, you might notice that the server is not under the expected load or that your database isn't being updated as expected. Incomplete or incorrect data correlation are likely causes of these problems. Here is a recommended procedure to help you identify data correlation problems early:

Necessarily, the test generator's data correlation algorithms are based on well-known best practices followed by application designers. Because these practices are continually evolving, these types of automated data correlation errors can occur:

Insufficient correlation: parameters have different names or appear in unexpected locations

Where two parameters that should be correlated have different names, automated data correlation fails to recognize that the two parameters are related. For example, consider the request http://www.madeupsite.com?id=12345. Instead of id=12345, the server response that this request should be correlated with is customer_id=12345. Parameter id needs to be correlated with customer_id.

Similarly, data correlation typically relates a response value returned from the server with a subsequent request value. The automated correlation algorithms look in the usual places -- URL and Post data -- for correlation candidates. But other schemes for returning parameters are possible. For example, consider the request http://www.madeupsite.com?id=12345. Instead of id=12345, the server response that this request should be correlated with is the name/entity pair href name="id" entity="12345". Parameter id needs to be correlated with name="id" and value 12345 with entity="12345".

A couple of more general examples:
  • Siebel uses the star array format: standard correlation algorithms do not understand how to retrieve from and substitute into this format.
  • SOAP designates correlation parameters in external XML files: the correlation algorithms do not understand the correspondence between parameters in the external file and in the test
To manually correlate in these cases:
  • Using test search or browsing, locate the two parameters that should be correlated.
  • Go to the parameter that appears first in the test. As explained in Creating a reference or field reference, put the parameter in a reference. (In some cases, this parameter might already be in a reference so this step isn't necessary.)
  • Go to the other parameter. As explained in Correlating a request value with a reference, correlate the second parameter with the earlier reference.

Insufficient correlation: one parameter is unnamed

It is possible that a parameter or value needs to be correlated with a previous parameter or value that is not named in the test, because it is computed (for example, by a Javascript program). In this case, in order to correlate correctly, you will need to understand how and where the parameter or value was computed, and then use a custom code block. Custom code is discussed in Extending tests with custom Java code.

For example, consider the URI http://www.madeupsite.com?login_stamp=12345_Dec_12_04, where login_timestamp is the concatenation of the login ID and today's date. In this case, you need custom code that performs the concatenation of the login ID and the date.

For another example, suppose that the server returned the login ID and date as separate entities (href "customer_id=12345" Date="Dec_12_04"). In this case, you can put these parameters in separate references and, in subsequent requests using customer ID and date, substitute them separately.

Over correlation

Automated data correlation is based on pattern matching: a parameter or parameter value is correlated with a subsequent parameter or parameter value with an exact or similar name. But sometimes parameters with exact or similar names are in fact unrelated. In the best case, unneeded correlation is either harmless or adds a slight load that is inappropriate. In the worst case, the application doesn't expect a correlation and fails during playback.

To remove a superfluous data correlation:
  • In the test editor, using search or browsing (correlated values appear in red), locate a value that should not be correlated.
  • Right-click the value and select Remove Substitution.
Alternatively, do the following:
  • In the test editor, click a page that contains inappropriately correlated requests.
  • Right-click anywhere in the Test Data table and select Show References.
  • Click a table row (red lettering) indicating an inappropriate correlation and click the Remove Substitution button under the table.

Incorrect correlation

A parameter requiring data correlation might appear many times throughout a test. For example, a session ID parameter that appears initially when a user logs in might appear in every subsequent request. It is possible that multiple instances of a parameter in a test are not the same, and that the correlation algorithms will choose the wrong instance.

The Test Generation preferences include a preference named Optimize automatic data correlation for:
  • Accuracy: each parameter occurrence is correlated with the nearest previous occurrence. This is the default.
  • Efficiency: each parameter occurrence is correlated with a single previous occurrence.
Incorrect instance correlations are less likely with the Accuracy setting, but they are still possible. To manually correct this problem:
  • In the Test editor, using search, browsing, or the page Test Data table, locate incorrectly-correlated values.
  • Right-click the value or table row and click Remove Substitution.
  • Again right-click the value, select Substitute from, and select the correct parameter.

Parent topic: Correlating response and request data in a test

Terms of use | Feedback
(C) Copyright IBM Corporation 2005. All Rights Reserved.