xUnit 框架和 BDD 可以一起工作吗?
我读过的一些资源.. 将 BDD 称为对“糟糕的 TDD”的回应。
- 行为规范与验证。测试和实现之间没有不适当的密切关系
- 在业务开发测试人员之间使用普遍/共享的语言
- 术语强调“行为”而不是“测试”。因此,给定何时、背景、场景、示例与测试套件、装置和案例。
- 实时规范
不确定我是否错过了更多好处..请参与。
鉴于大多数用户(可能是本地现象)在规范的创建/详细说明/澄清中进行“协作”,但没有对编辑/查看/执行/维护自动化版本感兴趣(当然他们希望软件满足所有规格):
xUnit(例如 NUnit)是否有任何方面阻止它从存在BDD 的好工具?
- 根据规范进行编写是一项与工具无关的技能。
- 无处不在的语言也是如此。只需要努力才能将其取出,
- 请注意上述限制。假设我采用与 BDD Give-When-Then 风格一致的 xUnit 测试命名风格。
- 我获取/创建一个工具,它使用上述命名约定从测试结果文件生成类似的“实时文档”。
有人可以在我定制的 BDD 地图上标记“Here be Dragons”吗?
Some of the resources I read.. refer to BDD as a response to 'Bad TDD'.
- Specification of behavior vs Verification. No inappropriate intimacy between tests and implementation
- Use of ubiquitous/shared language between business-development-testers
- Terminology emphasizes 'behavior' over 'testing'. So Given-When-Then, Context, Scenario, Examples vs Test Suites, Fixtures and Cases.
- Live specifications
Not sure if I've missed more benefits.. please pitch in.
Given that most users (maybe a local phenomenon) 'collaborate' in the creation/elaboration/clarification of the specifications but are not interested in editing/viewing/executing/maintaining the automated versions (of course they expect all the specs to be met by the software):
is there any aspect of xUnit (say NUnit for instance) that prevents it from being a good tool for BDD ?
- Writing in terms of Specifications is a skill that is tool-agnostic.
- Ditto for ubiquitous language. It just needs effort to get it out
- Note the above mentioned constraint. Assume I adopt a xUnit test naming style that is aligned with the BDD Given-When-Then style.
- I get/create a tool that uses the above naming convention to generate similar "live docs" from the test result files.
Can someone mark the "Here be dragons" on my customized BDD map...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么,这是给你的龙。
然而:
需要注意的是,“对不良 TDD 的反应”可能指的是 BDD 的早期,当时我们在类级别而不是在系统或应用程序级别进行操作。
我提供了场景和单元级行为,使用 NUnit 和 C# 中的 DSL 或 Moq 编写。对我有用。除非有明显的好处,否则不要选择自然语言工具。我对其中一项做出了广泛的贡献,因此我有权在不带偏见的情况下提出这一建议。
我希望我能为您提供+1以上的建议,以指出创建/阐述/澄清和编辑/查看/执行/维护之间的区别!
Here are the dragons for you, then.
However:
As a note, the "reaction to bad TDD" is probably referring to BDD's early days, when we did it at a class level instead of at a system or application level.
I offer examples of both scenarios and unit-level behavior, written using NUnit and a DSL or Moq in C#. Works for me. Don't go for the natural-language tools unless there's clear benefit. I have extensively contributed to one of them, so feel authorised to make this recommendation without prejudice.
I wish I could give you more than +1 for calling out the difference between creation/elaboration/clarification and editing/viewing/executing/maintaining!