我开始买入BDD了.基本上,正如我所理解的那样,您编写的场景描述了某些故事的良好接受标准.你从简单的测试开始,从外到内,使用模拟代替你尚未实现的类.随着进步,你应该用实际类替换模拟.从
Introduction to BDD开始:
At first,the fragments are
implemented using mocks to set an
account to be in credit or a card to
be valid. These form the starting
points for implementing behavIoUr. As
you implement the application,the
givens and outcomes are changed to use
the actual classes you have
implemented,so that by the time the
scenario is completed,they have
become proper end-to-end functional
tests.
我的问题是:当你完成一个场景时,你使用的所有类都应该是真实的,比如在集成测试中吗?例如,如果您使用DB,您的代码是否应该写入真实(但轻量级的内存)数据库?最后,你的端到端测试中是否应该进行任何模拟?
@H_404_18@