开发者

Scala testing: What's the status and relationship of SUnit, ScalaTest, ScalaCheck, Specs and ParTest?

Scala provides a choice of different testing frameworks, but I wonder if there are differences in the m开发者_C百科aturity 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?


  • SUnit no longer exists.
  • ScalaTest and Specs are mature, maintained, and receiving improvements (Specs2 is recently out, by the way). Choice between them is a matter of taste.
  • ScalaCheck doesn't have a particularly good runner, but both ScalaTest and Specs have special support for ScalaCheck integration. It is considered an important tool.
  • ParTest is used just for the compiler, as it tests stuff like "does this compile?" and "does this not compile?", error and warning messages, etc. It is not targeted at application development, and shouldn't be used for that.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜