课程章节
培训 · 课程 2. 需求和验证 · 第 2.5 章,共 6 章
2.5 验证和测试中心 2:55
规划每条需求的验证方式,编写带步骤的测试用例,并运行它。
演示 Holarch 2.13。
您将学到
- 为需求选择验证方法:检查、分析、演示或测试
- 在测试中心规划需求的验证方法、级别和成功标准
- 创建测试套件和验证某条需求的带步骤测试用例
- 运行测试并记录其结果
为 Bike-Share Dock 规划验证:为每条需求指定方法、级别和成功标准,创建包含验证某条需求的测试用例的测试套件,编写分步规程,并在测试中心运行以记录结果。
练习
在 Holarch 中基于 CubeSat EO-1 演示项目亲自完成此操作。
- 打开您的 EO-1 演示项目(或创建它:管理项目 → 项目文件 ▾ → 新建演示项目 → CubeSat(引导式系统工程))。
- 打开 验证 → 测试中心,滚动到 验证覆盖率。在 4.4 Downlink Encryption 上确认 I 已打开,在 级别… 下选择 子系统,并通过 + 标准 添加成功标准。
- 单击页面标题栏中的 + 新建 ▾ → 测试套件…,编号为
TS-4,命名为Mission Analyses,然后单击 创建。在其卡片上单击 + 测试用例,命名为Daily Collection Volume Analysis,并单击 验证 中的 + 选择 1.5 Daily Collection Volume(其方法为 Analysis,尚无测试)。 - 输入 预期结果,然后单击 + 步骤,添加两个各含一个操作和一个预期结果的步骤,再单击 应用。
- 在 TS-4 卡片上选择 ⋯ → 运行周期…,记录每个步骤,描述 实际结果,然后单击 ✔ 通过。
- 如需带检查的分步演练,请运行教程 9“验证需求”(帮助 → 教程)。
当 Daily Collection Volume Analysis 显示“通过”并带有您的姓名和日期,且 1.5 离开“未验证”列表时,即完成练习。
自测
- 对于 730 天任务寿命的需求,哪种方法合适?为什么?
- 为什么要在编写测试用例之前设定成功标准?
- 通过的测试用例会对其所验证的需求带来什么变化?
显示答案
对于 730 天任务寿命的需求,哪种方法合适?为什么?
Analysis:寿命无法在发射前测量,因此通过计算(例如可靠性估算)来证明。
为什么要在编写测试用例之前设定成功标准?
成功标准规定了证明需求已满足的可测量结果,因此测试会围绕该结果来设计,而不是测试恰好能测量什么就测什么。
通过的测试用例会对其所验证的需求带来什么变化?
需求的验证状态变为已验证,并从覆盖率卡片和 RVTM 的“未验证”列表中移除。
延伸阅读
文字稿
显示文字稿 (旁白和屏幕内容)
Introduction
Chapter five: verification and the Test Center. A requirement is only met when someone shows it is met. Verification plans how, and the Test Center records what happened.
We plan and run the first test for the Bike-Share Dock.
Plan verification
There are four ways to verify a requirement. Inspection looks at the product. Analysis shows it by calculation or simulation. Demonstration shows it working, without measuring. And test measures it under controlled conditions.
On screen: Card: verification methods.
Open Verification, then Test Center. Requirement Verification Coverage lists every requirement that is not verified yet. For Pay at the Kiosk, the method is already Test. Set the level to System, and add success criteria: the measurable outcome that shows the requirement is met.
On screen: Test Center → coverage → Pay at the Kiosk → Level → + Criteria.
Show Available Bikes is easiest to verify by demonstration: show the kiosk displaying the numbers. Click D on its row.
On screen: Show Available Bikes → D.
Test cases
Tests live in suites. Click New, choose Test Suite, give it the number TS-1 and the name Kiosk Acceptance Tests, and click Create.
On screen: + New ▾ → Test Suite… → TS-1 Kiosk Acceptance Tests.
On the suite, click Test Case, and name it Card Payment Time Test. Then click the plus in its Verifies column, and pick Pay at the Kiosk.
On screen: + Test Case → name → Verifies + → 5.1.1.
Type the expected result, and add the procedure as steps: click Steps, add each step with its action and expected result, and click Apply.
On screen: Expected Result; + Steps → two steps → Apply.
Run
Now run it. Click Run Tests. The dialog shows the procedure, the steps and the expected result. Record each step, describe the actual result, and click Pass.
On screen: Run Tests → step results → actual result → Pass.
The result is recorded with the tester, the date and the steps, and the test case now shows Passed. Close the dialog.
On screen: Close → Passed.
Recap
Let's recap. You learned the four verification methods, planned a method, level and success criteria, created a suite and a test case that verifies a requirement, wrote its steps, and ran it.
Next, the verification matrices: the RVTM and the VCRM, in Holarch and in Word and Excel.