You can extend the analysis performed by UTA with the Track option that monitors an object and compares its state before and after the execution of a selected method. This gives you insight into how particular values changed during execution and helps you make relevant assertions. 

Tracking Object Changes

  1. Run a test (see Executing Unit Tests with Unit Test Assistant).
  2. Open the test in the editor and  select a method.


  3. Click the Track button in the UTA interface. UTA will run the test and display information about the values that changed during execution and may need to be asserted.

  4. View the information about object changes in the Recommendation and Variables tabs.
    The Recommendations tab displays information about recommended assertions, along with values that changed during execution. You can click the Highlight link to view individual recommendations in the execution flow.



    The Variables tab displays information about values that were used during execution. Theicon indicates values that changed.



  5. Analyze information in the UTA interface to decide which assertions you want to make.

Creating Assertions

You can make assertions from both the Recommendations and the Variables tabs.

  • In the Recommendations tab, click the Make assertions link.

  • In the Variables tab, right-click the value you want to assert and choose Make assertions.


    Alternatively, you can copy the value with the Copy option to manually complete the code.

If the detected changes are in inaccessible fields, UTA generates assertion templates that require manual modifications of code:

You can enable or disable generating recommendations for inaccessible fields; see Configuring Preferences for details.



  • No labels

1 Comment

Write a comment…