Update Tests in Polyspace Platform User Interface
You can keep a Polyspace Platform project in sync with your source code repository throughout software development. For instance, when you update existing functions or data types in your source code, you can automatically update an existing graphical test to use the revised function prototype or type definitions. Any existing test information that is still applicable is retained during the update.
This topic shows how to update a graphical test authored in the Polyspace® Platform user interface. If you change a function’s signature, such as renaming or reordering its arguments, you can identify affected tests and remap them to the updated function directly within the user interface.
Find Tests That Need Update
To find which tests in a project require an update because of code under test changes:
Right-click the Tests node of a project and select Validate Tests.
Tests with validation issues are shown with a
icon next to them.On the Logs pane, note which test steps have an invalid code under test.
If you open such a test step, you can see that the code under test does not exist.
Update Test
To update the function in a test step with an invalid code under test:
Double-click the test on the Projects pane and open the test.
Right-click the step node in the left side of the test case editor and select Update Code Under Test.
In the Update Code Under Test dialog box, select the new function from the Replace function with list and click OK.

On the Remapping Code Under Test dialog box, you see a mapping between the old and new functions. If the data type of a function parameter in the new function is equivalent to the data type of the corresponding parameter in the old function, the parameter is considered unchanged. Otherwise, it is considered as new.
Adjust the mapping as needed. For instance:
If a function parameter is considered as existing by the software but is actually a new parameter, change the value in the Mapping column from New to Existing.
If you reordered two parameters of a function but both parameters are considered as new, change the values in the Mapping column from New to Existing. Then, in the Old Function Data column, select the parameters to map to.

Alternatively, to map the old function to a new function, select the new function from the Code Under Test drop-down list in the test step and then select Remap data.
Test Updates During Function Remapping
When you map the old function in a test step to a new function:
You see these changes in the Inputs section of the step:
If you marked a function parameter as existing, it is retained along with its previous value. If you marked it as new, the parameter is entered with a default value (the same value as if you were creating the test for the first time). Parameters that no longer exist are removed.
If a global variable value was read during execution of the old function and continues to be read in the new function, it is retained in the test along with its previous value. If its data type changes and the new type is incompatible with the old, the global variable input is inserted with default values. Global variables that are no longer read-accessed in the new function get removed. No new global variables are entered.
If the new function shares a callee with the old function and the callee happens to be mocked, any relevant mock variable input is retained during update.
You see these changes in the Assessments section of the step:
If you marked a return value as existing, the assessment for the return value is retained. If you marked it as new, any existing assessment on a return value is removed and a new assessment is entered with default values.
If you marked a function parameter as existing, any assessment on the parameter is retained. No new assessments are added for new parameters. You can add them explicitly after update as needed.
If a global variable value was written during execution of the old function and continues to be written in the new function, any existing assessment on the variable is retained along with its previous value. If its data type changes and the new type is incompatible with the old, the global variable assessment is inserted with default values. Assessments on global variables that are no longer write-accessed in the function get removed. No new assessments are entered for global variables. You can add them explicitly after update as needed.
If the new function shares a callee with the old function, assessments on the call count of the callee are retained. If the callee happens to be mocked, assessments on mock variables exported from the callee are retained.
You see these changes in the Callees section of the step:
If the new function shares a callee with the old function, it is retained during update. If the callee happens to be mocked, it continues to be mocked after update.
Any callee of the old function that is not a callee of the new function is removed during update.
Any new callee of the new function is added during update.
In addition to function interface changes, changes in type definition can also affect a test. For instance, you might change a structured type to add or remove a member. Following a code under test update, all test elements in the test step and test header are updated to the latest definition of the type:
The test elements in the Inputs and Assessments section of the test step that use this type get updated.
For instance, if you add a new member to an existing structured type, for inputs using the type, this new member is entered with default values.
The test elements in the Test Data and Test Parameters sections of the test header that use this type also get updated.