Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

With Unit Test Assistant you can easily create multiple test cases for methods from an abstract class and its super classesa selected class, as well as files or packages selected in the Project Explorer. The methods are analyzed to create runnable test cases with initial values and sample assertions, which can be easily modified or uncommented. You can add test cases using the UTA interface or the Eclipse context menu.

  1. If the Unit Test Assistant view is not already open, choose Parasoft> Show View> Unit Test Assistant from the Eclipse menu bar.
  2. Select a class in the editor.
  3. Click the Add test case(s) button.

  4. Select the methods you want to create test cases for and specify the test type: regular or parameterized (see Creating a Parameterized Unit Test for details on creating parameterized test cases).



  5. Click OK.
  6. View the tests to modify or uncomment the default UTA values if necessary.



  7. Run the test with UTA to collect coverage information and recommendations for possible improvements (see Executing Unit Tests with Unit Test Assistant).

 


Alternatively, you can add test cases using the Eclipse context menu:

...

  • You can specify the test type (regular or parameterized), but you cannot specify individual methods.
  • UTA will skip the files that are not testable or whose corresponding test classes already exist.