Boo 是编写单元测试的好选择吗?
我正在 Castle 堆栈上使用 C# 进行开发。 我是单元测试的新手,而且我听说更灵活的语言(比 C#)可能会使编写测试更容易。
您认为仅仅为了编写单元测试就值得花时间学习 Boo 吗?
我们使用 SharpDevelop IDE,因此可以使用 Boo 支持,我一直在寻找学习新 CLR 语言的借口,但我只是不想让它妨碍学习单元测试。
I'm developing in C# on the Castle stack. I'm new to unit testing, and I've heard that a more flexible language (than C#) might make writing tests easier.
Do you think it is worth the time to learn Boo just for writing unit tests?
We use the SharpDevelop IDE, so have Boo support available, and I've kind of been looking for an excuse to learn a new CLR language, but I just don't want it to get in the way of learning unit testing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为了真正利用 Boo 作为测试语言,请查看 Spectre(作为 Boo DSL 实现的 BDD 框架)。 否则,它只是另一种使用 xUnit 的 CLR 语言。
如果您刚刚开始进行单元测试,我同意 Esko 的观点,只需使用 C# + NUnit,您就会找到更多信息和示例代码。
这是一个网络项目吗? 学习 Boo 的另一个好借口是使用 Brail视图引擎(最初来自 Monorail,但现在 也可用于 ASP .NET MVC)
In order to really take advantage of Boo as a testing language, take a look at Specter (a BDD framework implemented as a Boo DSL). Otherwise it's just another CLR language using xUnit.
If you're just starting out with unit testing, I agree with Esko, just go with C# + NUnit, you'll find much more information and sample code.
Is this a web project? Another good excuse for learning Boo is using the Brail view engine (originally from Monorail but now also available for ASP.NET MVC)
如果您是单元测试的新手,那么最好使用熟悉的语言,至少在您掌握基础知识之前(可能需要几周)。 当您觉得您使用的语言/框架过于冗长或限制性时,请尝试其他方法。
我主要使用 Java 进行开发,但我计划转向 Scala。 将来我可能仍然用 Java 编写应用程序代码的某些部分,但对于测试我更喜欢使用 Scala、Ruby、Groovy 或具有更灵活语法的类似语言。 例如,使用 Java/C#,您需要使用长的描述性方法名称进行测试,但使用更灵活的语言,您可以仅使用纯字符串,这使得测试名称更具可读性: http://www.codecommit.com/blog/java/the-brilliance-of-bdd
If you're new to unit testing, it might be best to use a familiar language at least until you have the basics under control (maybe a couple of weeks). When you feel that the language/framework that you use is too verbose or restrictive, try something else.
I'm developing mostly in Java, but I'm planning on moving to Scala. In the future I might still write some parts of the application code in Java, but for the tests I would prefer using Scala, Ruby, Groovy or similar language with a more flexible syntax. For example, with Java/C# you need to use long descriptive method names for the tests, but with a more flexible language you can use just plain strings, which makes the test names much more readable: http://www.codecommit.com/blog/java/the-brilliance-of-bdd
如果这在你的公司在政治上是可行的,那么可能是这样。 测试代码的耦合度通常比生产代码低得多,让您可以随意使用和探索所使用的语言。 这将为您提供学习新语言的良好环境。
If it's politically viable at your company, probably. Testing code usually has much less coupling than production code, letting you get away with playing with and exploring the language used. This would make it a good environment to get your hands on a new language.