Record Test Cases from a Code Debug Eclipse Debugging Session


We recommend that you compile your program and provide a current source listing (see also Compile Programs) before you generate a test.

When developers need to test any COBOL program behavior changes, they would initiate a Code Debug session to generate a test and validate their change.

  1. Restart debugging the program in Code Debug which stops at the main program entry.
  2. Find the sub-program for which to collect test data.
  3. Right-click and select image2021-8-16_16-42-34.pngRecord Test Case… on the Procedure section of the program on which to collect data. For more details, see Context-Menus-from-Code-Debug-Session.
  4. In the Record Test Case dialog box, select the program to be recorded and select an existing project or create a new project.
    pg102_1.png
  5. To record, select either Record the program specified in launch configuration or Record a called program option. If Record a called program option is selected, enter the Program nameLoad module, and Maximum program executions to record field.
  6. Select the project from the Project drop-down or create a new one using the NEW button.
  7. Select a test folder from the Folder drop-down or enter a new folder name.
  8. In the Scenario drop-down, the last scenario specified for this program is pre-selected. Otherwise, a new scenario is displayed, using the name of the program with the suffix _Scenario (<program>_Scenario), for example, CWKTVSKS_Scenario.
  9. Optionally, you may specify the project's test suite into which the recorded test scenario will be copied.
  10. Select which test to record, either Unit Test (Virtualized Test - default), Functional Test (Non-virtualized Test), or both.

    Important

    The Functional Test selection is only available when using a Repository Server (Window > Preferences > BMC > 

    BMC AMI DevX Total Test

     > Repository Server with check box Use repository server.)

  11. If you selected Functional Test, select the Host connection from the Functional TestEnvironment drop-down list. Use the Configure button to add or modify a connection.

    Important

    The Unit TestOptions tab includes fields and settings specific for generating Unit Test test cases. Refer to Context-Menus-from-Code-Debug-Session for detailed descriptions.

  12. Click OK to create the test case.
  13. If so desired, use the Code Debug session to change variable values at this point.
  14. Issue the appropriate Run commands in your Code Debug session. Code Debug collects and saves the program entry data from the structure specified by the Using Statements.
  15. Code Debug continues executing the rest of the program. For a Data Stub to be created, at least one Read or one Write must be executed in Code Debug during data collection. When the program ends or is stopped, Code Debug transfers the collected data to Total Test.
  16. The new Test Scenario(s) appear in the Test Project previously specified. Select the new Test Scenarios in the Test Project Explorer View. Total Test populates the project folders with the transferred data.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*