📜  存根

📅  最后修改于: 2020-12-04 06:40:28             🧑  作者: Mango


什么是存根?

自上而下的集成测试过程中使用存根,以模拟尚未集成的较低级别模块的行为。存根是充当被调用模块的临时替换并提供与实际产品相同输出的模块。

当软件需要与外部系统交互时,也会使用存根。

存根-流程图

存根在自上而下的集成测试中的作用

上图清楚地表明,模块1、2和3可用于集成,而下面的模块仍在开发中,目前无法集成。因此,存根用于测试模块。集成的顺序为:

1,2
1,3
2,Stub 1
2,Stub 2
3,Stub 3
3,Stub 4

测试方法:

+ Firstly, the integration between the modules 1,2 and 3
+ Test the integration between the module 2 and stub 1,stub 2
+ Test the integration between the module 3 and stub 3,stub 4