tags:

views:

118

answers:

3

Between the following test frameworks which one is the easiest to use and learn?

I'm using 2.8.0 and sbt for building, so working nicely with it is a factor. I'm not necessarily looking at the most full featured. As best I can tell my criteria are in order:

  • allow unit testing for Scala code
  • painless set-up
  • working with sbt
  • tutorials
  • rich documentation
+4  A: 

In my opinion, specs is the most popular testing framework, and I think you should give it a try first, and see if it fits your job.

Works great with sbt with virtually no setup. Not sure how rich you want the documentation to be, but I was able to find most of the info from the website (start with Quickstart), and when I had problem people were helpful in the mailing list.

eed3si9n
+7  A: 

I learned Scala by writing a suite of tests for my Java-based application. I used ScalaTest, and found it easy. I understand that ScalaTest offers a greater range of testing styles, including the Behavior-Driven Development (BDD) style employed by Specs. The greater scope of ScalaTest appealed to me because different styles lend themselves to different types of testing; for example, BDD is commonly used for unit testing, whereas the FeatureSpec style would be more appropriate for integration or acceptance testing.

Another consideration is support. Although I cannot speak for the Specs community, I can report that support from the author of ScalaTest has been quick, encouraging, and very useful.

David
+1  A: 

They all fit your requirements. Of the three, the one I think is weaker would be ScalaCheck -- weaker docs, less flexible, and different enough from traditional testing that there's more to learn. On the other hand, ScalaCheck is often used with ScalaTest or Specs, to complement their functionality with non-deterministic properties testing.

Daniel