博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
test double
阅读量:6543 次
发布时间:2019-06-24

本文共 2162 字,大约阅读时间需要 7 分钟。

In and , and employ a technique called to enhance the quality of the software. Frequently, the final release software consists of a complex set of or interacting together to create the final result. In automated unit testing, it may be necessary to use objects or procedures that look and behave like their release-intended counterparts, but are actually simplified versions that reduce the complexity and facilitate testing. A test double is a generic (meta) term used for these objects or procedures.

 

Types of test doubles

Gerard Meszaros identified several different terms for what he calls, "Test Doubles." Using his vocabulary, there are at least five types of Test Doubles:

  • (used for providing the tested code with "indirect input")
  • (used for verifying "indirect output" of the tested code, by first defining the expectations before the tested code is executed)
  • (used for verifying "indirect output" of the tested code, by asserting the expectations afterwards, without having defined the expectations before the tested code is executed. It helps in recording information about the indirect object created)
  • (used as a simpler implementation, e.g. using an in-memory database in the tests instead of doing real database access)
  • (used when a parameter is needed for the tested method but without actually needing to use the parameter)

For both manual and automated of or and use test doubles that communicate with the over a network protocol. These test doubles are called different names depending on the tool vendor. A commonly used term is . Other names used include , API mock, HTTP stub, HTTP mock, over the wire test double .

Another form of test double is the Verified Fake, a whose behavior has been verified to match that of the real object using a set of tests that run against both the Verified Fake and the real implementation.

While there is no for test double and the various types, there is momentum for continued use of these terms in this manner. used these terms in his article, Mocks Aren't Stubs referring to Meszaros' book. Microsoft also used the same terms and definitions in an article titled, Exploring The Continuum Of Test Doubles.

转载地址:http://bpodo.baihongyu.com/

你可能感兴趣的文章
为什么有人讨厌 Google 的新 Logo?
查看>>
腾讯2017暑期实习编程题3
查看>>
Intellij IDEA 构建Spring Web项目 — 用户登录功能
查看>>
[AHOI2013]作业
查看>>
git push被忽略的文件 处理
查看>>
C#中用ILMerge将所有引用的DLL打成一个DLL文件
查看>>
PHP生成HTML静态页面
查看>>
Makefile 中:= ?= += =的区别【转】
查看>>
使用makecontext实现用户线程【转】
查看>>
Comet:基于 HTTP 长连接的“服务器推”技术
查看>>
BZOJ 2733: [HNOI2012]永无乡 启发式合并treap
查看>>
四种方法校验数组中是否包含某个指定的字符串
查看>>
29、Java并发性和多线程-非阻塞算法
查看>>
安装OpenResty开发环境
查看>>
第0课 从0开始
查看>>
hadoop无法启动DataNode问题
查看>>
java泛型中<?>和<T>区别
查看>>
这里是指推送通知跟NSNotification有区别:
查看>>
用户ID的代码生成
查看>>
win7经常出现“关闭xxxx前您必须关闭所有会话框”
查看>>