使用 ASP.NET MVC 2 的最佳 BDD 框架是什么? C#4?
当我观看 Scott Guthrie 在瑞典。一位听众向 Scott 询问 VS2010 和 ASP.NET MVC 如何支持 BDD。
之后,我搜索BDD(行为驱动开发),当与 TDD(测试驱动开发) 进行比较。我找到了一些适用于 Ruby 和 Java 的框架。但我不知道任何著名的.NET 框架。
请向我推荐 BDD 框架及其优点/缺点总结。
附言。建议的 BDD 框架必须在 .NET 4、C# 4.0 和 ASP.NET MVC 2 上运行良好。
谢谢,
I just heard about BDD when I watch video of Scott Guthrie in Sweden. One of listener asked question to Scott about How VS2010 and ASP.NET MVC do to support BDD.
After that, I search about BDD (Behavior Driven Development) that focus on specification more than unit testing when compares with TDD (Test Driven Development). I found some framework that work with Ruby and Java. But I do not any famous framework for .NET.
Please suggest me about BDD framework and summary PROs/CONs of it.
PS. Suggested BDD framework must work great on .NET 4, C# 4.0 and ASP.NET MVC 2.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我看到这个问题已经有答案了,我还没有尝试过NBehave。但是,我们在这个相当大的企业项目中使用 MSpec (Machine.Specifications),它是我们在这里工作得很好。非常值得一提。
Rob Conery 制作了一个有关学习 BDD 的精彩视频,其中他逐行使用了 MSpec:
(链接已删除,不再可用,但请搜索它)
Rob Conery 提供的有关 MSpec 的更多信息以及他使用它的原因。
http://wekeroad.com/2009/09/21 /make-bdd-your-bff-2/ 您可能还想查看他标记为 BDD 的其他帖子。
优点:
缺点:
希望有帮助。
I see this question already has an answer, and I have not tried NBehave. But, we are using MSpec (Machine.Specifications) for this fairly large Enterprise project and it is working quite well for us here. Very well worth mentioning.
Rob Conery did an EXCELLENT video on Learning BDD, where he uses MSpec, line by line:
(link removed, no longer available, but search for it)
More about MSpec from Rob Conery, and why he uses it.
http://wekeroad.com/2009/09/21/make-bdd-your-bff-2/ You might also want to check out his other posts tagged BDD as well.
Pros:
Cons:
Hope that helps.
我建议尝试 SpecFlow 没有人提到它,这很奇怪。这里有一篇关于 将 BDD 与 Specflow 和 Asp.Net MVC 结合使用它开源并托管在 GitHub 上
规范流程使用我个人非常喜欢的 GWT(Given When then)语法。到目前为止,我们已经取得了巨大的成功,现在尝试使用 SpecFlow 来实施 BDD。现在还处于早期阶段,但到目前为止一切进展顺利。
优点:
缺点:
我鼓励您尝试一下。
I'd recommend trying SpecFlow It's weird that no-one's mentioned it. There's a great article here about using BDD with Specflow and Asp.Net MVC It's open source and is hosted on GitHub
Spec flow uses the GWT (Given When Then) syntax which I personally really like. We've had great success so far with BDD now trying to implement using SpecFlow. It's still early days yet but so far it's going well.
Pros:
Cons:
I encourage you to give it a go.
在确定您不需要太多框架后,我构建了 StoryQ。它非常轻量级,嵌入到您现有的测试运行程序中,请在 http://storyq.codeplex.com 上查看
I built StoryQ after deciding that you didn't need much of a framework. It's very lightweight, embeds in your existing test runner, check it out at http://storyq.codeplex.com
您看过NBehave吗?您可能还想看看这个老问题 。但我还想补充一点,恕我直言,可以使用任何类型的单元测试框架来执行 BDD。一种简单直接的方法是将您的“测试类”命名为“Given_X”,然后让所有“测试方法”的名称如“It_should_Y”。
Have you looked at NBehave? You also probably want to look at this old question. But I would also like to add that IMHO it is possible to do BDD using any kind of unit testing framework. A simple straight forward way is to name your "test class" something like "Given_X" and then let all your "test methods" have names like "It_should_Y".
Storevil
非常轻量 http://code.google.com/p/storevil/
Storevil
Very light weight http://code.google.com/p/storevil/
您知道 Goiko Adzic 介绍如何使用 Concordion.NET 用简单英语进行 BDD 的视频吗?
http://gojko.net/ 2009/09/01/acceptance-testing-in-plain-english-with-concordion-net/
Do you know the video of Goiko Adzic on how to do BDD in plain English using Concordion.NET?
http://gojko.net/2009/09/01/acceptance-testing-in-plain-english-with-concordion-net/
试试这个:https://www.nuget.org/packages/Heleonix.Testing。 NUnit
它与 NUnit 一起使用,但提供了类似于 JavaScript 中的 Jasmine 或 Jest 的语法,采用 Give/When/Then 和 Arrange/Act/Assert 样式
Try this one: https://www.nuget.org/packages/Heleonix.Testing.NUnit
It works with NUnit, but provides syntax like Jasmine or Jest in JavaScript in Given/When/Then and Arrange/Act/Assert styles