繁体   English   中英

Specflow - 作为功能文件/BDD 的一部分涵盖的测试类型是什么

[英]Specflow - What is the testing type which is covered as part of feature file/BDD

这可能是一个愚蠢的问题,但仍然试图找到我对 BDD Specflow 的理解。 根据我在 Specflow 的经验 - 看到不同的公司使用 Specflow 来捕获场景/测试 -

  • 组件级测试
  • 功能测试
  • 系统集成测试
  • 回归测试

因此,例如我的以下系统集成测试覆盖功能-

Given An active account exists
When I  fill up a form & submit a new investment (submitted but not approved)
Then Check the record inserted into a specific table
And new transaction displayed in Holdings report
And new transaction not displayed in cash balance report (as not yet approved)

在一些公司中,他们练习将其进一步分解-组件

将上述场景分为以下 2 个功能 -

  1. 一个验证直到插入到数据库

    Given An active account exists When I fill up a form & submit a new investment (submitted but not approved) Then Check the record inserted into a specific table
  2. 其他 检查报告

    Given A new Investment is recorded When we run the reports Then new transaction displayed in Holdings report And new transaction not displayed in cash balance report (as not yet approved)

以上哪一项是编写 Specflow 功能的正确方法? 什么是最佳实践?

IMO,根据 BDD 指南,更好的方法是您上面写的第二个选项。 因为您在第二种情况下有点涵盖了不同的行为。 任何时候场景需要两个 when-then 语句,最好有单独的场景。 这里查看,这正好解决了您的问题。 您甚至可以检查时态,看看它们在上面的场景中是否正确。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM