Test Case
R2026bDescription
The test case document enables you to author graphical C/C++ tests in the Polyspace® Platform user interface.
Graphical test cases are organized by test suite, and each test case can contain one or more tabular or scripted test steps:
Tabular test steps allow you to specify the function under test, which automatically populates tables of inputs, assessments, and callees based on information derived from your source code. Using tabular test steps reduces manual setup and maintains consistency between your source code and tests.
Scripted test steps allow you to write custom C/C++ code to implement test logic, call multiple functions, or use test constructs that are not supported in tabular test steps. Scripted test steps combine the simplicity of graphical test authoring with the flexibility of writing tests as code.
Graphical test authoring also provides built-in support for requirements linking, test parameterization, function call counts, and call sequence assessments. If your source code changes, Polyspace Test™ can automatically update your existing graphical tests while preserving applicable test data.
You can save graphical test cases as part of the .psprjx project file,
or in a separate .pstestd file that is referenced by the project. Saving
test cases as separate .pstestd files enables you to modularize your
project and share or reuse those graphical test cases with similar projects.
Open the Test Case
Polyspace Platform Toolstrip: On the Project tab, in the Test section, click Add Test or Add Scripted Test.
Projects pane: Right-click the Tests node or a test suite node and select Add Test Case. Or, double-click the name of an existing test under the Tests node to edit it in the test case document.
Examples
- Write Multistep Tests in Polyspace Platform User Interface
- Create Function Call Sequence Assessments
- Test C/C++ Functions by Using Scripts in Graphical Tests
- Override Callee Definitions When Testing Functions in Polyspace Platform User Interface
- Run Same Test with Different Inputs in Polyspace Platform User Interface
- Specify Pointer Targets for C/C++ Test Authoring in Polyspace Platform User Interface
- Author Graphical Tests Using Python API for Polyspace
- C/C++ Test Authoring Tips and Tricks
Parameters
Tips
Parse source code before authoring tests to automatically populate function interfaces, inputs, and assessments. See Parse Source Code for Auto-Populating Test Information in Polyspace Platform User Interface.
Duplicate an existing test case to use it as a starting point for a new test case.
To view the code that gets generated for a graphical test, use the Test Code button in the View section of the Test Case toolstrip tab. Viewing the generated test code can be helpful for understanding a graphical test and useful for debugging.
For scripting and workflow automation, use the Polyspace Python API to create, modify, or run graphical tests. See Author Graphical Tests Using Python API for Polyspace.
Version History
Introduced in R2023bSee Also
Topics
- Polyspace Platform: A Unified Platform for Static Analysis and Dynamic Testing
- Test Authoring in Polyspace Platform User Interface
- Functions and Data Types Not Supported for Graphical Test Authoring in Polyspace Platform User Interface
- Test Execution in Polyspace Platform User Interface
- Create Easily Shareable Projects for Version Control
- Modularize Project by Converting Graphical Tests to Test References in Polyspace Platform User Interface
- Update Tests in Polyspace Platform User Interface
- Link C/C++ Sources and Tests to Requirements
- Review C/C++ Test Execution Results
