BDD被吹捧为“TDD做得对”. 然而,TDD广泛用于单元测试,而不是端到端集成测试. 哪种测试最适合BDD? 我们应该只编写集成测试吗? 我们还应该编写单元测试吗? 如果是,每个方案应该进行
然而,TDD广泛用于单元测试,而不是端到端集成测试.
哪种测试最适合BDD?
>我们应该只编写集成测试吗?
>我们还应该编写单元测试吗?
>如果是,每个方案应该进行多次单元测试吗?
>单元测试涵盖多种情况?在使用MSpec等测试框架时,有没有办法构建这些测试?
Which kind of test (integration tests, unit tests) is most appropriate for BDD?
我会在两个嵌套循环中使用它们,如Behavior-Driven Development with SpecFlow and WatiN中所述
* writing a failing integration tests * writing a failing unit test as part of the solution of the integration test * making the unittest pass * refactor * writing the next failing unit test as part of the integration test * unitl the integration test passes * writing the next failing integration tests