Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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?

like image 803
soc Avatar asked Aug 01 '11 17:08

soc


2 Answers

  • 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.
like image 195
Daniel C. Sobral Avatar answered Nov 20 '22 03:11

Daniel C. Sobral


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.

like image 45
paradigmatic Avatar answered Nov 20 '22 04:11

paradigmatic