unit-testing - BDD 是否应该通过单元测试、集成测试或两者都自动化?

标签 unit-testing tdd integration-testing bdd

BDD 被吹捧为“TDD 做对了”。

然而,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
    

    关于unit-testing - BDD 是否应该通过单元测试、集成测试或两者都自动化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5957847/

    相关文章:

    python - 不应自动运行的 Django 测试

    java - 我怎么知道是否在被测单元上调用了方法?

    ruby-on-rails - 我开始在 Rails 中进行测试,但我不确定我的测试

    c# - MVC4 TDD - System.ArgumentNullException : Value cannot be null.

    javascript - Karma vs 测试框架 Jasmine、Mocha、QUnit

    java - Java 功能测试

    rest - Spring Boot 的 TestRestTemplate 和 HATEOAS PagedResources

    Python/Django - 针对列表进行测试

    java - 任何基于 YAML 的 Java fixture 加载器?

    python-3.x - 在Python中添加Mock对象