Implement data correlation for test generation

 

+

Search Tips   |   Advanced Search

 

To implement data correlation for test generation, become familiar with these classes:

To implement data correlation for test generation and script editing, model elements must extend...

...so that you can associate data sources and substituters with model elements. Also, when you extend those classes, make sure you implement the code to make Substituters and DataSources persist in model. For more information, refer to the model documentation.

You need to create own data correlation plug-in to extend the extension point DCTestgenProto, which is defined in the plug-in...

To extend the extension point, code must implement the interface IProtoElementAdapter which is defined in...

Then, when you extend the DCTestgenProto extension point, use the following items:

The other element details are:

After you have extended the data correlation extension point, the main data correlation engine will call code with all the elements of the model type that you defined.

There are two parts to data correlation at testgen time. The first part is automatic data correlation which happens at testgen time. This will happen through a call to...

When this method is called automatically by testgen, it will in turn call two main methods in plugin. Those methods are...

The findSubs() method should return a list of substituters that are found for the current element that is passed into method, and null if there were no substituters found.

The findReference() method should try to find a reference for the substituter passed into it.

You start looking for references at the element before the substituter and keep working backwards in the testsuite until you find a suitable reference. If no reference is found, return null. CorrelateAll is used to find all correlations that you can so that the user does not have to manually find them at test editing time.

The other parts of the IProtoAdapter class are called at test editing time when a user wants to create a substitution site, a reference, or make a correlation between a substitution site and a reference. If you are creating own type of Substituters or DataSources, makeDataSource() and makeSub() methods will be used for that. You will be passed the DCStringLocator class with all the information about offsets and text that you need. Use this DCStringLocator to determine what substituter or data source to create and then call back into IDataCorrelator. Correlations, substituters, and data sources are created in the model for you. Read the documentation on the IDataCorrelator class to learn which methods are right for purposes.


Related tasks

  • Implement data correlation for execution