Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space ENGINES1031 and version 10.4.0

...

Table of Contents
1
maxLevel3
exclude2

Anchor
Filtering Recommendations
Filtering Recommendations
Filtering Recommendations

Recommendations for test improvements are displayed in the Recommendations view after tests are executed (see Configuring Preferences for information how to specify which recommendations UTA will generate). By default, all recommendations generated during the run are displayed, but you can filter out specific recommendations by selecting a category from the drop-down menu at the top of the Recommendations view:

...

  • Go to - Highlights the code associated with the recommendation in the editor.
  • Highlight - Highlights the issue in the execution flow displayed in the left columnUnit Test Assistant View.

Recommendations can also include:

  • the Learn more... link which opens a page with details about individual recommendations,
  • the Track[method_name] action link which detects values that may need to be asserted; see Tracking Object Changes and Creating Assertions for more information,
  • action links that automatically update your test code (for example, Uncomment removes specific comment markers in test templates generated by UTA, and Remove Assertion deletes the line with an unnecessary assertion).
Info
iconfalse
titleEnsure that recommendations are up to date before you use the action links

UTA displays recommendations for test code that was analyzed when the tests are run. If you change your code after test execution, recommendations may not be up to date, and the action links may not be applied appropriately.

Working with Recommendations

This section shows several examples of Unit Test Assistant recommendations and how they can be used to improve the quality of your test.

...

UTA detected a new file that was created during the test run, but was not removed after execution. This may affect subsequent test runs or other tests, as well as hide potential problems within the application, such as resource leaks.

Remedy: Ensure that the files created by the test are removed before the end of the test run.

...

Remedy: Manually modify the test to reduce its execution time or set a new timeout by modifying the value in the test code:

Uncovered Code

UTA detected code that is not covered. Click Go to navigate to the uncovered code.

Image Added

Remedy: You can do one of the following:

  • Modify or extend an already existing test case to cover the code. For example, you may need to modify the method parameters.
  • Manually copy an existing test case, and then modify the duplicate to cover the code.
  • Click the Clone test action link to display a list of existing test cases that have been executed; then select a test case you want to duplicate and modify.  UTA preselects a test case to clone based on the test case coverage and name (if the coverage is identical, UTA selects the test case with the highest consecutive number in its name). This quick fix is available only for regular tests.

UTA may display hints how the test case should be modified to cover the code.

Recommendation Types

See Recommendation Types for information about the types of recommendations UTA can display.