Editing test cases
The test case editor enables you to visually design test cases associated with your source code and to create variable checks.
About this task
The test case editor is made of two panes:
- The Activity diagram displays a flow chart describing the blocks that are required in the test case. If necessary, you can add and remove blocks, conditions and arrow lines to edit the activity diagram. The test case criteria are contained in one or several Check blocks.
- The Details pane contains information about the selected block. For example, click the Inits & Stubs block to edit the initialization parameters, headers, and stubs required to run the test case.
Tip: You can find where the edited file is located
by clicking on the title of editor or on the header and selecting . The explorer selects the current
test case and expands automatically all parent nodes.
The main objective of editing a test case is to define the variable and structure checks in the Check block.
Procedure
- In the project explorer, open a test case.
- In the Activity diagram, create the
necessary blocks for the test case and connect them with connector
lines.The default flow chart contains an Init. & Stubs block, followed by a Code block, followed by a Check block.
-
On the Requirements page, document requirements that are specific to your
program or quality process. You can enter the name, a comment, and if a web page exists in your
requirement management tools, enter the link to the web page that displays the requirement. You can
also add requirements that come from a .cvs file.
- To add a requirement, click and enter a name for the requirement. You can modify the name. The table is editable, you can modify the name of the requirement, add a comment and add a link to a web page that is used as requirement in the table.
- Click to duplicate a requirement in the table.
- Click to view the requirement in a browser.
- Click to add a requirement from a list. This button is available only if you previously set the preferences to retrieve the requirements from a .cvs file. For more information, see Link Tests to Requirements. The requirements are filtered by name and comment. In the test reports, you can find the list of tests associated with the list of requirements.
- In the Activity diagram, select a
check block.The Checked Variables table displays the variables and structures contained in the function under test.
- For each variable or structure, specify an initial value
and an expected value.These values can be simple values, multiple values (ranges, series) or C structures.Note: By default, the Obtained Value column displays the actual value for the variable obtained during the last run. Use the Available Runs list, located at the top of the test case editor, to display the actual values obtained during a specific run.
- When you have finished editing the test case, click Save and close the test case.