相关术语简介
test fixture:测试夹具
In xUnit, a test fixture is all the things we need to have in place in order to run a test and expect a particular outcome.
depended-on component (DOC) :第三方依赖组件
An individual class or a large-grained component on which the system under test (SUT) depends. The dependency is usually one of delegation via method calls. In test automation, it is primarily of interest in that we need to be able to examine and control its interactions with the SUT to get complete test coverage.
SUT:被测系统
Also known as: AUT, MUT, CUT
The "system under test". It is short for "whatever thing we are testing" and is always defined from the perspective of the test. When we are writing unit tests the system under test (SUT) is whatever class (a.k.a. CUT), object (a.k.a. OUT) or method(s) (a.k.a. MUT) we are testing; when we are writing customer tests, the SUT is probably the entire application (a.k.a. AUT) or at least a major subsystem of it. The parts of the application that we are not verifying in this particular test may still be involved as a depended-on component (DOC).
测试四阶段
测试四阶段按顺序依次为:
-
fixture setup(建立)
准备测试的前置条件 -
exercise SUT(运行)
对被测系统进行操作 -
result verification(验证)
检查预期的输出 -
fixture teardown(拆卸)
把被测系统恢复到测试前的初始状态
测试四阶段标准化的好处
- 测试过程清晰明了、良好的可读性与结构性
- 实现测试即文档(Tests as Documentation)
参考
Four-Phase Test
《测试驱动的嵌入式C语言开发》