测试生成
R2026b使用 Polyspace® Copilot 为边界值、覆盖率目标或功能需求生成测试
在 Polyspace 平台用户界面中,您可以自动生成与特定目标相关的测试输入。例如,您可以生成使用输入的边界值调用函数的测试,或生成覆盖了函数中所有条件的 true 或 false 结果的测试(全条件覆盖)。
您还可以使用 Polyspace Copilot 生成功能测试来验证功能需求。
系统命令
polyspace-test -generate-tests | (System Command) Generate C/C++ unit tests automatically in a Polyspace Platform project |
polyspace-test -create-testgen-config | (System Command) Create a default configuration file for automatic test generation in a Polyspace Platform project |
主题
自动化结构测试生成
- Generate C/C++ Tests for Boundary Values of Function Inputs
Generate tests that call functions with boundary values for inputs. - Generate C/C++ Tests for Code Coverage Objectives
Generate tests that satisfy predefined coverage objectives. - Generate C/C++ Tests to Diagnose or Guard Against Input Related Defects
Generate non-regression tests from Bug Finder results showing input-related defects. - Generate Additional C/C++ Tests for Missing Code Coverage
Generate tests that satisfy predefined coverage objectives, taking into account existing tests. - Constrain Values and Target Sizes in Generated C/C++ Tests
Fix some input values while generating others, fix pointer target size. - Generate C/C++ Tests for Scripts Calling Functions
Generate scripted tests for functions not supported for graphical test authoring. - Limitations of Automatic C/C++ Test Generation
See why automatic test generation with Polyspace Test™ might not work in certain cases.
使用 Polyspace Copilot 生成功能测试
- Generate Functional Tests Using Polyspace Copilot
Generate tests that validate functional requirements using Polyspace Copilot from the Polyspace Platform user interface. - Limitations of Test Generation Using Polyspace Copilot
See why test generation using Polyspace Copilot might not work for certain functions.
使用 Requirements Toolbox 从需求生成测试
- Generate C/C++ Tests from Requirements (Requirements Toolbox)
Generate and link C/C++ tests from requirements implemented as C/C++ source code. (自 R2026b 起)