The Component Testing Wizard helps you create a new Component Testing test node in your project for C, C++, Ada and Java.
For each script type, the wizard analyzes the source code under test to extract unit information and will produce a corresponding test script template using the following test script types:
C Test Script Language
C++ Test Driver Script Language
C++ Contract-Check Language
Ada Test Script Language
JUnit Test Harness
You use the generated test script template to elaborate your own test cases.
You can later add to this test node any of the runtime analysis features included in Test RealTime .
There are two methods of creating a test node with the Component Testing wizard:
From the Start page: this method allows you to specify a set of files or components to test.
From the Asset Browser: this method rapidly creates a test from a single file or source code component selected in the Asset Browser.
Once the test node has been generated, you can complete your Component Testing test scripts in the Text Editor. Refer to the Test RealTime Reference Manual for information about the actual language semantics.
To run the Component Testing Wizard from the Start Page:
Use the Start Page or the File menu to open or create a project. Ensure that the correct Configuration is selected in the Configuration box.
The selected programming language
impacts the type of Component Testing test node to be created.
On the Start Page,
select Activities
and choose the Component Testing activity.
The Application Files page opens. Use the Add and Remove buttons to build a list of source files and header files (for C and C++) to add to your project.
The Configuration Settings button
allows you to override the default Configuration Settings.
Select Compute Static Metrics to run the analysis of static testability metrics.
Click Next> to continue.
Note If the static metrics analysis takes too much time, you can clear the Compute Static Metrics option. In this case, the calculation and display of static metrics in any further steps are disabled.
Note With Component Testing for Ada, it is not possible to submit only an Ada procedure file. Instead, you must include the single procedure in a package.
The Components Under Test page allows you to select the units or files for the selected source files.
In order to help you choose which
components you want to test, this page displays the metrics for each file
or unit (packages, classes or functions depending on the language).
Select File Selection to choose files under test or Unit
Selection to choose the source code units that
require testing. The selection mode toggles the static metrics displayed
between file metrics or unit metrics.
Note If the Unit Selection view seems incomplete, cancel the wizard, from the Project menu, select Refresh File Information and restart the wizard. See Refreshing the Asset Browser.
Click Metrics
Diagram to select the units under test from a
graph representation.
Click Next>
to continue or Generate to skip any further configuration and to use default settings.
The Test Script Generation Settings page allows you to specify the test node generation options. The General settings specify how the wizard creates the test node.
Test Name: Enter a name for the test node.
Test Mode: Disables or enables the test boundaries.
Typical Mode: No test boundaries are specified. This is the default setting. For Java, all dependency classes are stubbed in the node.
Expert Mode: This mode allowing you to manually drive generation of the test harness. This provides more flexibility in sophisticated software architectures.
Node Creation Mode: Selects how the test node is created:
Single Mode: In C and Ada, this mode creates one test node for each source file under test. In C++ and Java, it creates one test node for all selected source code components.
Multiple Mode: This creates a single test node for each selected source code unit.
The Components Under
Test settings specify advanced settings for each
component of the test node. These settings depend on the language and
Configuration.
Click Next> to continue.
Review the Summary. This page provides a summary of the selected options and the files that are to be generated by the wizard.
Click Next> to create the test node based on this information.
The Test Generation Result page displays progression of the test node creation process. Click Settings to set the Configuration Settings. You can always modify the test node Configuration Settings later if necessary, from the Project Explorer.
Note If you apply new settings after the test generation, the wizard reruns the test generation. This allows you to fine-tune any settings that may cause the test generation to fail.
Once a test node has been successfully generated, click Finish to quit the Component Testing Wizard and update the project.
To run the Component Testing Wizard from the Asset Browser:
Use the Start Page or the File menu to open or create a project.
Ensure that the correct Configuration is selected in the Configuration box. The selected programming language impacts the type of Component Testing test node to be created.
In the Project Explorer, select the Asset Browser tab.
Right click an object, package or source file under test. From the popup menu, select Test.
The Test Script Generation Settings allows you to specify the test node generation options. The General settings specify how the wizard creates the test node.
Test Name: Enter a name for the test node.
Test Mode: Disables or enables the test boundaries.
Typical Mode: No test boundaries are specified. This is the default setting. For Java, all dependency classes are stubbed in the node.
Expert Mode: This mode allowing you to manually drive generation of the test harness. This provides more flexibility in sophisticated software architectures.
The Components Under Test settings specify advanced settings for the component of the test node. These settings depend on the language and Configuration.
Click Next> to continue.
Review the Summary. This page provides a summary of the selected options and the files that are to be generated by the wizard.
Click Next> to create the test node based on this information.
The Test Generation Result page displays progression of the test node creation process. Click Settings to set the Configuration Settings. You can always modify the test node Configuration Settings later if necessary, from the Project Explorer.
Note If you apply new settings after the test generation, the wizard reruns the test generation. This allows you to fine-tune any settings that may cause the test generation to fail.
Once a test node has been successfully generated, click Finish to quit the Component Testing Wizard and update the project.
Related Topics
Component Testing for C and Ada | Component Testing for C++| Component Testing for Java