English 中文(简体)
BDD(有光谱)
原标题:Outside-in BDD (with Specflow)

I m new to BDD, but I found it is very interest and wish to develop my next project using BDD. 在 go和观看屏幕后,我仍然有许多关于实际生活中的捍卫布隆迪人权的问题。

1. Declarative or Imperative Options?

大部分特定时段假设情况 我看到,我是根据“倡议”(简化)撰写的。

Scenario: Login
     Given I am on the Login-page
     When I enter  AUser  in the textbox  UserName 
       And I enter  APassword  in the textbox  Password 
       And I click the  Login  button
     Then I should see the following text  You are logged in 

我发现这些测试极易碎,没有说明点击纽州的商业价值。 我认为,它的梦.可以维持。 为什么大多数实例都使用必要的假设情景?

Scenario: Login (declarative)
     Given I am not logged in
     When I log in using valid credentials
     Then I should be logged in

如果你更喜欢申报风格,那么你如何描述诸如家庭页或产品页之类的 st?

2。

Most of steps implementations I saw used WatiN, White or something like that to implement scenarios from user point of view. Starting browser, clicking buttons. I think its extremely slow and brittle. Well, I can use something like Page object to make tests less brittle. But thats another amount of work. Especially for desktop applications with complex UI.

你们如何在实际生活项目中执行假想——通过测试控制员/介绍人进行。

<>strong>3. Real database or not?

在实施部分假想时,往往需要系统的某些数据(例如,某些产品申请商店)。 你们如何执行这一部分——将数据添加到真正的数据库(全端到终端测试),或向控制人员提供存放处的麻烦?

Waiting for experienced answers!

UPDATE: 在问题上添加有用的链接

最佳回答
  1. Declaritive is the proper way, IMO. If youre talking about page .aspx file names, you re doing it wrong. The purpose of the story is to facilitate communication between developers and non-develoeprs. Non-developers don t care about products.aspx, they care about a product listing. Your system does something the non-developers find value in. This is what you re trying to capture.

  2. Well, the stories tell the high level features you need to implement. Its what your system must do. The only way to really tell if you ve done this is to in fact exercise the UI. BDD SpecFlow stories to me don t replace unit tests, rather they re you re integration tests. If you break this, you ve broken the value the business gets from your software. Unit tests are implementation details your users don t care about, and they only test each piece in isolation. That can t tell you if A and B actually work together all the time (in theory it should, in practice interesting [read: unexpected] things happen when you actually have the two parts playing with each other). Automated end to end tests can help with your QA as well. If a functional area breaks, you know about it, and they can spend their time in other areas of the application while you determine what broke the integration tests.

  3. 这是一种骗局。 我们采取混合办法。 我们确实使用数据库(在所有测试系统作为一件事而不是单个部件运作之后进行综合测试),而不是重新确定我们使用Deleporter在需要时用Moqs取代我们的储存库的所有时间。 Seems to work ok,但肯定有利弊。 我认为,我们在很大程度上仍然把这一局面igu成一片。

问题回答

。 仅仅谈论特定领域以避免碎片情景的概念

他的主要观点是,你可以谈论的最低领域是问题领域和解决领域。 如果你再谈论这两个领域以外的任何东西,那么你就会让太多的利益攸关方参与进来,你就会提出太多的噪音,你会把情景ttle。

他还提到绝对的“申报”或“简化”模式是神话。 他谈到一个称为“king”的合谋模式,他说,在你的精髓中,你可以“chu”或“chu”。 这意味着你可以更明确(如何?)或更多(什么或为什么?) 要求“我们做什么?” 说“我们怎么做? 因此,我猜测,我 t太 h地听说说话,在问题发生时,我赢得你们的 t。

什么地方会把每一术语属于哪一个领域,或许可以确定哪一个利益攸关方是该术语属于哪一个领域的专家。 一旦确定所有领域,你就可以在最突出的领域之一选取相关术语are/em>,或完全删除不合适的声明。 如果这还不够,你可以分割、进一步说明或改变情况,以便满足这些要求。

BTW,他还利用在国库中的伐木情景,因此,你会得到具体指导:

Before Edit: (some of this still applies. The "DB or no DB" and "UI or no UI" questions are unrelated)

1 - 申报或推定假设情景?

何时可以宣布,尽管必须具有一定价值(在项目生命周期的某些点)。

Imperative is an easier way to think for testers and business analysts who aren t as familiar with information theory and design. It is also easier to think about earlier on in a project, before you ve nailed down your problem domain and workflows. It can be useful for exploratory thinking.

声明的修改时间缩短。 由于德国马克公司是申请中最易受到鞭.的部分,因此,这极为宝贵。 一旦你放弃问题领域和工作流程,并且更注重关系概念,就更容易思考。 这是一个更稳定和更普遍适用的模式。

如果你用通用和申报模式撰写测试案例,你可以采用全方位自动数据系统自动化、集成测试或单位测试等方法加以实施。

你们如何描述诸如主页或产品页之类的 st?

我不相信我会达到特征和要求的基本水平。 你们可以提出子术语和次要求,说明执行细节,如具体的工作流程。 如果你重新描述“国际调查”的一部分,那么你应当界定“国际调查”的特点/要求。

2 - 进行国际调查吗?

两者兼有。

我认为,它极其缓慢和bri。

是的。 在每个高层次的假设情景/要求中,都与统一数据库和完全的行文统一,但不会在结束统一倡议自动化时采用每一条代码道路,而且肯定不会有edge。 如果你这样做,你就会花更多的时间去工作,而实际时间则要少得多。

您可以确定申请的结构,以便你能够进行降低成本一体化测试,包括单单单单单单单单单单单单单单单单单单单单单单单单单单单单单进行测试。 单位测试也是宝贵的。

但是,你进行的一体化测试越少,head头破碎的 b子就会再错。 可能更容易撰写单位测试,当然会减少碎片,但根据定义,你无法测试你的申请。

3 - 实际数据库或无数据库?

两者兼有。

必须在全面制度下进行高级别的终端到终端一体化测试。 这包括真正的非行,在不同的服务器上对每个系统进行测试等。

你们越低,我就越提倡 mo。

  • Unit tests should only test individual classes
  • Mid-level integration tests should avoid expensive, brittle, and impactful dependencies such as the file system, databases, the network, etc. Try to test the implementation of those brittle and impactful dependencies with unit tests and end-to-end tests only.

不用提及一页,而是描述它所代表的内容,例如:

Scenario: Customers logs in successfully

  When I log in
  Then I should see an overview of ACME s top selling products

You can test directly against underlying APIs or models, but the more you do this, the more you risk not catching an integration issue. One approach is to balance things with a small number of full-stack tests, and a larger number which test between two layers only.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...