输入、评估、桩件和仿件
指定测试输入和评估、对未定义的函数被调用方进行插桩、覆盖函数被调用方
您可以在 Polyspace 平台用户界面中以交互方式编写图形化测试。图形化测试由一个或多个步骤组成。在每个步骤中,选择要测试的函数并指定测试输入和评估。对于输入和评估,测试用例编辑器支持基本数据类型的变量,也支持聚合(结构体、枚举值等)和指针等复杂数据类型的变量。
在每个测试中,您必须将任何未定义的被调用方替换为函数桩件。您也可以选择使用仿件函数覆盖被调用方定义。
主题
输入
- Specify Test Inputs in Polyspace Platform User Interface
Specify test inputs of fundamental, structure, enum, array or pointer data types. - Specify Pointer Targets for C/C++ Test Authoring in Polyspace Platform User Interface
Specify arrays as targets for pointer inputs and assessments. - Set Global and Static Variables in Polyspace Platform User Interface
Set and reset global variables inside steps, or define setup and teardown functions and call them from distinct steps. - Run Same Test with Different Inputs in Polyspace Platform User Interface
Iterate test inputs through test data arrays keeping function call sequence fixed.
评估
- Specify Test Assessments in Polyspace Platform User Interface
See which types of assessments can be directly entered in the Polyspace® Platform user interface.
桩件和仿件
- Test Functions with Undefined Callees in Polyspace Platform User Interface
Test partially written code, see which symbols are undefined, use predefined stubs to emulate undefined functions. - Override Callee Definitions When Testing Functions in Polyspace Platform User Interface
Create and save mocks for function callees that access hardware, reuse overrides across tests. - Change Mock or Stub Implementation Based on Test
Define a single mock or stub that has different implementations in different tests. - Differences Between Stubs and Mocks When Testing C/C++ Functions
Stubs provide definitions for undefined functions, mocks override already defined functions.
可感知 AUTOSAR 的桩件
- Create Project and Write Tests for AUTOSAR Software Component Implementations
Create project from AUTOSAR specifications and code implementation, generate smart stubs, author tests, and review test results. - Anatomy of Run-Time Environment Function Stubs Generated from AUTOSAR Design Specifications
See how function stubs for RTE functions are generated from AUTOSAR design specifications.
用 C/C++ 编写的测试(xUnit 测试)
- 在 Polyspace 平台用户界面中向工程添加 C/C++ xUnit 测试
使用 Polyspace Test™ xUnit API 编写测试并从 Polyspace 平台用户界面执行这些测试。
限制
- Functions and Data Types Not Supported for Graphical Test Authoring in Polyspace Platform User Interface
See a partial list of limitations of test authoring in the Polyspace Platform user interface and how to work around them. - Test C/C++ Functions by Using Scripts in Graphical Tests
Enter scripted steps to invoke unsupported functions but add step inputs and assessments graphically.