Main Content

跟踪需求实现进度

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

在本教程的这一步,您将查看 myAddReqs 需求集的实现状态,将 MATLAB® 代码链接的链接类型更改为 Implement,并对从实现状态中排除 myAddTestSpecification 的需求进行申诉。

查看实现状态

打开 myAdd 工程。

openProject("myAdd");

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

slreq.open("myAddReqs");

启用实现状态。在视图部分,选择显示需求 > 表格视图,然后选择 > 实现状态。通过点击刷新,确保 Requirements Toolbox 分析的是实现链接的功能需求。

The implementation status for myAddReqs is shown in the Requirements Editor. The status bar is empty. The mouse points to the status bar and displays the tooltip.

空的实现状态栏表示需求没有实现链接。通过指向需求集的实现状态栏,查看有关实现状态的详细信息。工具提示指示需求未实现。

将需求链接到 MATLAB 代码中,您创建了需求与实现这些需求的 myAdd 函数之间的链接,但实现状态指示需求没有实现链接。当您创建需求与 MATLAB 代码之间的链接时,默认情况下,Requirements Toolbox 会将链接类型设置为 Relate。实现状态仅会检查类型设置为 Implement 的链接。

更改链接类型

在需求编辑器中,点击显示链接。选择 myAdd~m.slmx 中的第一个链接。在右窗格中的属性下,将类型设置为 Implements

In the Requirements Editor, link #! is selected in the myAdd~m link set. In the right pane, under Properties, the mouse points to the Implements menu item in the Type menu.

将链接集中其他链接的链接类型设置为 Implements,然后保存链接集。通过点击显示需求,查看更新后的实现状态。

蓝色实现状态栏表示需求已实现。实现状态的工具提示指示 myAddReqs 中有四个需求具有实现链接。

对排除测试需求进行申诉

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

slreq.open("myAddTestSpecification");

myAddTestSpecification 中的测试需求没有指定功能设计的行为,因此不需要实现。通过将每个需求与申述链接起来,对从实现状态排除需求进行申诉。右键点击需求 1.1,然后选择申述 > 链接到新实现申述

Requirements Toolbox 会向 myAddTestSpecification 需求集添加一个申述层次结构。对需求 1.2 和 2.1 至 2.4 重复此步骤,然后保存需求集。

The implementation status is shown for the myAddTestSpecification requirement set. The mouse points to the status bar and displays the tooltip.

浅蓝色实现状态栏表示已对排除在实现状态之外的需求进行了申述。需求集的实现状态栏的工具提示指示,需求集的八项需求中有六项已完成申述,可以从实现状态中排除。

更改需求类型

对于实现状态,Requirements Toolbox 会检查实现链接中是否存在类型设置为 Functional 的需求。在 myAddTestSpecification 中,具有摘要 Validity checksFunctional tests 的需求充当测试需求的容器。但是,它们的类型设置为 Functional,因此它们包含在实现状态中。通过在需求编辑器中选择需求,然后在右窗格的属性下,将类型设置为 Container,以更改这两项需求的需求类型。保存需求集。

In the Requirements Editor, requirement 1 in myAddTestSpecification is selected. In the right pane, under Properties, the Container menu item is selected in the Type menu.

需求编辑器会从实现状态中排除容器需求。工具提示会指示需求集中的六项功能需求已完成申述。

The implementation status is shown and the mouse points to the status bar, displaying the tooltip.

另请参阅

App

相关主题