Scala 测试:SUnit、ScalaTest、ScalaCheck、Specs 和 ParTest 的地位和关系如何?
Scala 提供了不同的测试框架的选择,但我想知道它们的成熟度和稳定性以及它们提供的独特功能是否存在差异。
是否有一种特定的方法可以适合所有类型的开发?
不同的框架可以相互操作,或者可以与针对其他语言的测试运行程序进行互操作吗?
Scala provides a choice of different testing frameworks, but I wonder if there are differences in the maturity and stability they have and which distinct features they provide.
Is there a specific one which should fit for all kinds of development?
Can the different frameworks inter-operate with each other or with test runners targeted for other languages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ScalaTest 和 Specs 具有非常相似的语法和功能列表,并且都被社区采用。它们都允许单元测试和验收测试。
ScalaCheck 有着完全不同的理念。测试生成随机实例并检查某些属性是否成立。属性和生成器可以用一个很好的函数惯用法来定义和组合。 ScalaTest 和 Specs 允许您在测试中编写 ScalaCheck 属性。
在开始使用 Scala 编程之前,SUnit 已被删除,所以我不知道它是如何工作的。在你提出问题之前我从未听说过 ParTest。
ScalaTest and Specs have a very similar syntax and feature list and they are both adopted by the community. They both allow unit and acceptance tests.
ScalaCheck has a radically different philosophy. Tests generate random instances and check taht some properties hold. Properties and generators can be defined and composed in a nice functional idiom. ScalaTest and Specs allow you to write ScalaCheck properties inside tests.
SUnit was removed before a started programming in Scala so I have no idea how it worked. I never heard of ParTest before your question.