Main Content

跟踪需求验证进度

您可以通过在需求编辑器中查看验证状态来跟踪需求的验证进度。Requirements Toolbox™ 会检查需求集中的每项功能需求,以查看它们是否具有验证链接,并将结果汇总为反映需求集的总体验证进度的状态。

在本教程的这一步,您将查看 myAddTestSpecification 需求集的验证状态,运行链接的 MATLAB® 测试,并查看已验证的需求。

查看验证状态

打开 myAdd2 工程,该工程与 myAdd 工程相似,但它包含您在前面步骤中更改的文件的更新版本。

openProject("myAdd2");

在需求编辑器中打开 myAddTestSpecification 需求集。

slreq.open("myAddTestSpecification");

视图部分中,选择 > 验证状态。点击刷新,确保 Requirements Toolbox 分析的是验证链接的功能需求。

The Requirements Editor verification status is shown for the myAddTestSpecification requirement set. The mouse points to the status bar, displaying the tooltip, which indicates that there are six unexecuted requirements.

黄色验证状态栏表示需求具有验证链接,但您尚未执行测试。满格状态栏表示需求集中的所有需求都具有验证链接。容器需求 1 和 2 被排除在验证状态之外。

运行 MATLAB 测试

测试文件 tMyAdd.m 包含链接到 myAddTestSpecification 需求集中的需求的测试。打开该测试文件。

open tMyAdd

通过运行链接的 MATLAB 测试来验证需求。在需求编辑器中,右键点击 myAddTestSpecification 需求集,然后选择运行测试。在“运行测试”对话框中,确保已选择测试,然后点击运行测试

The Run Tests dialog is shown for the myAddTestSpecification requirement set. The dialog box shows the seven linked tests, indicates that tMyAdd is the test source file, and displays the index of the linked requirement for each test.

查看已验证的需求

在需求编辑器中,绿色验证状态栏表示测试通过,将验证需求集中的功能需求。

The Requirements Editor verification status is shown for the myAddTestSpecification requirement set. The mouse points to the status bar, displaying the tooltip, which indicates that there are six passed requirements.

另请参阅

App

函数

相关主题