I reviewed a few Scala unit testing frameworks today: SCUnit, and Rehersal. When all was said and done I determined something that I found rather remarkable - TestNG is the best unit testing framework for Scala. Why aren't new Unit Testing frameworks up to snuff? The problem with any new unit testing framework in a new language is that it doesn't have IDE support. This is a huge pain in the ass for someone who relies on their IDE for everything (like me). TestNG already has IDE support, and you can use Java Annotations in Scala, so you can use TestNG just fine in Scala as well.Read Jack's complete post: http://jackcoughonsoftware.blogspot.com/2007/12/unit-testing-in-scala-and-in-ides-in.html
Blogs: Unit Testing in Scala and IDE's
Java has blossomed numerous unit testing frameworks throughout the years, in this blog entry by Jack Cough he takes us through the process of using one such framework -- TestNG -- but with the twist of using Scala: http://jackcoughonsoftware.blogspot.com/2007/12/using-testng-in-scala-by-example.html Jack also explores two other unit testing frameworks specifically targeting the Scala language, but comes to several conclusions on their capabilities, more mature Java testing frameworks and IDE's
- Posted by: Daniel Rubio
- Posted on: January 11 2008 15:32 EST
I wanted to leave the following comment on Jack's blog, but I couldn't. Hi Jack, Maybe you would like review the library I created: specs It uses Scala features to make your tests more readable (in my mind,...). It also integrates Scalacheck which is an incredible tool to add to your unit testing toolbox. With specs, you can run the tests as JUnit tests so there is a minimal integration with the IDE. With some issues though: -the current Eclipse plugin doesn't support Scala 2.6.1 (this causes some RuntimeExceptions) -you have to create a separate Java project to run the tests (see the wiki) -you can't jump to the code from a test Following your post, I'll investigate the possibility of piggy-backing on TestNG runners to see if I can provide a better integration to the IDEs. Please have a look at specs, I would be interested by your feedback. Eric.
Eric, I tried specs and tried to email you. I'm hoping to talk to you about it more. -Jack