unit-testing - 对微服务的每个版本进行一组测试?

标签 unit-testing testing tdd bdd microservices

对于微服务,我是否需要像这样为每个服务的每个版本创建测试文件夹:

一个

- Services
  - users
     - v1
         - src
         - tests
             - functional
             - unit
             - integration
     - v2
         - src
         - tests
             - functional
             - unit
             - integration
     - v3
         - src
         - tests
             - functional
             - unit
             - integration

B

- Services
    - users
       - v1
            - src
       - v2
            - src
       - v3
            - src
       - tests
            - functional
            - unit
            - integration

C

- Services
   - users
      - v1
      - v2
      - v3
   - tests
      - functional
      - integration
      - unit

D

- Services
   - users
      - v1
      - v2
      - v3
- Tests
    - functional
    - integration
    - unit

最佳答案

通常你会得到这样的结果

- Solution
    - IntegrationTestsFolder
          -IntegrationTestsProject1
          -IntegrationTestsProject2
    - BusinessLayerProject
    - BusinessLayerTestProject

因此您将在目标代码附近进行测试。

您不太可能拥有与单元一样多的集成测试项目,并且它们可能未与源项目一对一映射,因此您可能希望将它们全部嵌套在 IntegrationTests文件夹。

至于版本控制,您真的对所有内容都进行了双重/版本控制吗?如果您最终得到几个不同版本的类,您可以在实际的单元/集成测试中单独针对它们。

关于unit-testing - 对微服务的每个版本进行一组测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39323491/

相关文章:

testing - 使用 Jmeter 或 Badboy 记录 AJAX 请求和弹出窗口

ios - 单元测试(猕猴桃): Property is always nil in test after loadView and viewDidLoad are called

ruby-on-rails - 当我想测试我的助手类时,无法在 ActionView::TestCase 中使用 flash

java - 从多个 UnitTest 类为 Junit TestMethods 创建 TestSuite

javascript - 有没有更好的方法来测试类的各个方法

python - 仅当另一个单元测试通过时才运行 python 单元测试

django 项目中的 Javascript 测试,具有 CI 和覆盖率

css - 在线响应式 Web 测试仪

python - 使用 behave (python) 定义场景(或所需场景)的顺序

Java 泛型 : <? > vs 捕获<?>