课程章节
培训 · 课程 2. 需求和验证 · 第 2.1 章,共 6 章
2.1 编写需求和质量检查 3:37
编写带属性的需求,并让质量检查找出措辞薄弱之处。
演示 Holarch 1.27。
您将学到
- 将需求编写为一条带可测量数值、可测试的 shall 语句
- 在规格说明的章节下添加需求
- 设置需求的优先级、验证方法、理由和类型标签
- 对文档运行质量检查,并修正其标记的需求
- 自行审查需求后标记 Correct 和 Feasible
在 Bike-Share Dock 规格说明中编写需求:什么是好的需求,在章节下添加需求,填写优先级、验证方法和理由,为其添加标签,运行需求质量检查,修正一条薄弱的需求,并记录评审者的判断。
练习
在 Holarch 中基于 CubeSat EO-1 演示项目亲自完成此操作。
- 打开您的 EO-1 演示项目(或创建它:管理项目 → 项目文件 ▾ → 新建演示项目 → CubeSat(引导式系统工程))。
- 打开 需要与需求 → 文档 → EO-1 System Requirements Specification。选择章节 5 Communications,单击 + 子条目,将需求命名为
Command Link Margin,并编写一条带数值的 shall 语句(例如,在 5 度仰角下至少有 6 dB 余量)。 - 在属性面板中将 Priority 设为 High,将 Verification Method 设为 Analysis,并填写 理由,然后单击 + 标签 并选择 Performance Requirement。
- 打开 需要与需求 → 质量,在范围栏中选择 Document: EO-1 System Requirements Specification,然后单击 检查质量。阅读 2.5 Safe Mode Recovery 的 建议。
- 将 2.5 改写为一条可测量的语句(什么触发恢复、多快恢复、恢复到哪种模式),然后再次单击 检查质量。
- 审查您的改写,然后单击该行 Correct 和 Feasible 下的 ✘,将其标记为“是”。
当 2.5 Safe Mode Recovery 的得分高于之前、其建议不再指出含糊的词语,且 Correct 和 Feasible 显示 ✔ 时,即完成练习。
自测
- 为什么用 and 连接的需求即使两部分都很好,得分也会更低?
- 为什么自动检查永远无法标记 Correct 和 Feasible?
- 为什么像 quickly 这样的词在需求中是个问题?
显示答案
为什么用 and 连接的需求即使两部分都很好,得分也会更低?
它把两条需求合为一条。它们无法分别验证、追溯或更改,因此检查会将其标记为不满足单一性。
为什么自动检查永远无法标记 Correct 和 Feasible?
需求是否表达了正确的需要、能否实现,需要工程判断。由人审查该需求并标记这两项标准。
为什么像 quickly 这样的词在需求中是个问题?
它无法测量,因此任何测试都无法证明需求已被满足。请用一个数值和单位替换它。
延伸阅读
文字稿
显示文字稿 (旁白和屏幕内容)
Introduction
Welcome to Requirements and Verification. This track follows requirements from the first draft to the proof that the system meets them, on the Bike-Share Dock from Getting Started.
This first chapter is about writing requirements well, and letting Holarch check them.
A good requirement
A good requirement states one thing the system shall do, in words that can only mean one thing, with a value someone can test. Vague words such as fast or user friendly cannot be tested, and two requirements joined by and cannot be checked separately.
On screen: Card: a good requirement.
Write requirements
Open the specification. Select section 5.1, Timing and Throughput, open the menu next to After, and choose Add Child. Name the requirement Pay at the Kiosk, and write its statement in the inspector.
On screen: SRS → 5.1 → Add Child → Pay at the Kiosk.
Add two more the same way: an environmental requirement under 7.1, and a usability requirement under 8.3. The usability one is written the way requirements often are on a first try.
On screen: 7.1 → Operate in Cold and Heat; 8.3 → Friendly Kiosk.
Attributes and labels
Each requirement also has attributes for planning. Select Pay at the Kiosk, and set its priority to High, its verification method to Test, and its rationale: why the value was chosen.
On screen: 5.1.1 → Priority, Verification Method, Rationale.
Give it a label too: click Label in the inspector, and choose Performance Requirement. Labels let you filter and report by kind.
On screen: + Label → Performance Requirement.
Quality check
Now check the wording. Open Needs and Requirements, then Quality, choose the specification, and click Check Quality. Each requirement is scored against nine qualities of a good requirement, with a tick or a cross for each.
On screen: Quality → Document: the SRS → Check Quality.
Friendly Kiosk scores low. The findings name the problems: user friendly and quick cannot be measured, and the and joins two requirements in one.
On screen: Findings for Friendly Kiosk.
Fix it. Go back to the document, select the requirement, and rewrite it as one measurable statement.
On screen: Back to the SRS → 8.3.1 → new description.
Check the quality again. The score rises. Two qualities, correct and feasible, always need a person: when you have reviewed a requirement, click their crosses to mark them yes.
On screen: Quality → Check Quality again → mark Correct and Feasible.
Recap
Let's recap. You learned what makes a requirement good, added requirements under sections, filled in their attributes and labels, ran the quality check, fixed a weak requirement, and recorded your own judgment.
Next, you trace the stakeholder needs to these requirements.