This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Defacto Scala unit test library ?

7 replies
Java Artisan
Joined: 2010-07-20,
User offline. Last seen 2 years 15 weeks ago.
If I'm not mistaken, many people are using ScalaTest for unit testing. But is it thé library to use ? Like you would for JUnit in Java.
And if ScalaTest is the most advised for Scala, what "style" (http://www.scalatest.org/quick_start) are Scala developers usually developing in ? JUnit ? BDD ? Features ?
Bill Venners
Joined: 2008-12-18,
User offline. Last seen 31 weeks 5 days ago.
Re: Defacto Scala unit test library ?
Hi Jan,
I'm not sure there is one at this point. People are using all of ScalaTest, specs, ScalaCheck, JUnit, and TestNG. If you want to get started with ScalaTest and have no other preference, I'd suggest starting with FunSuite.

Thanks.
Bill----Bill VennersArtima, Inc.http://www.artima.com
On Jun 5, 2011, at 12:59 PM, Jan Goyvaerts <java [dot] artisan [at] gmail [dot] com> wrote:

If I'm not mistaken, many people are using ScalaTest for unit testing. But is it thé library to use ? Like you would for JUnit in Java.
And if ScalaTest is the most advised for Scala, what "style" (http://www.scalatest.org/quick_start) are Scala developers usually developing in ? JUnit ? BDD ? Features ?
marc
Joined: 2011-06-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Defacto Scala unit test library ?
I will second Bill's response.  I am a big fan of ScalaTest, especially when used in combination with ScalaCheck.   I use a combinationof FeatureSpec and the BDD style for my work (with should matchers).
I played around with Specs2 a bit.  But I found I was faster in Scalatest, but that is very subjective.
Aaron Novstrup 2
Joined: 2011-03-30,
User offline. Last seen 42 years 45 weeks ago.
Re: Defacto Scala unit test library ?

It can depend a lot on the kind of testing you need to do.

I tend to use ScalaTest with the BDD style for unit tests. I can see
how other styles would be more useful for higher-level testing
(functional, integration, acceptance).

ScalaCheck (http://code.google.com/p/scalacheck/) supports a
completely different style of testing, which is especially useful for
testing functional programs. It automatically generates tests based
on the input/output behavior you specify, and when tests fail, it
searches for the minimal set of inputs that can lead to failure. As
such, it is an excellent complement for Specs/ScalaTest when you need
to test functional components.

On Sun, Jun 5, 2011 at 11:59 AM, Jan Goyvaerts wrote:
> If I'm not mistaken, many people are using ScalaTest for unit testing. But
> is it thé library to use ? Like you would for JUnit in Java.
> And if ScalaTest is the most advised for Scala, what "style"
> (http://www.scalatest.org/quick_start) are Scala developers usually
> developing in ? JUnit ? BDD ? Features ?

Paulo Siqueira
Joined: 2011-04-13,
User offline. Last seen 42 years 45 weeks ago.
Re: Defacto Scala unit test library ?
I'm personally having lots of fun with specs2. I tried ScalaTest as well, but I found it easier to integrated specs in my environment, which includes a few maven projects and a mix of Java and Scala projects all the time.

[]s,

2011/6/6 Aaron Novstrup <aaron [dot] novstrup [at] gmail [dot] com>
It can depend a lot on the kind of testing you need to do.

I tend to use ScalaTest with the BDD style for unit tests.  I can see
how other styles would be more useful for higher-level testing
(functional, integration, acceptance).

ScalaCheck (http://code.google.com/p/scalacheck/) supports a
completely different style of testing, which is especially useful for
testing functional programs.  It automatically generates tests based
on the input/output behavior you specify, and when tests fail, it
searches for the minimal set of inputs that can lead to failure. As
such, it is an excellent complement for Specs/ScalaTest when you need
to test functional components.

On Sun, Jun 5, 2011 at 11:59 AM, Jan Goyvaerts <java [dot] artisan [at] gmail [dot] com> wrote:
> If I'm not mistaken, many people are using ScalaTest for unit testing. But
> is it thé library to use ? Like you would for JUnit in Java.
> And if ScalaTest is the most advised for Scala, what "style"
> (http://www.scalatest.org/quick_start) are Scala developers usually
> developing in ? JUnit ? BDD ? Features ?



--
Paulo "JCranky" Siqueira
Visit my blog: http://www.jcranky.com/
wfaler
Joined: 2009-04-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Defacto Scala unit test library ?
ScalaTest and Specs2 are both excellent libraries, which one you prefer will probably be a matter of taste rather than one being "better" than the other.
Both libraries have good communities and lots of users, so are both likely to stick around.
My suggestion would be: try both and see which one you prefer, though be prepared to indecision if you do! :)
On 7 June 2011 04:26, Paulo Siqueira <paulo [dot] siqueira [at] gmail [dot] com> wrote:
I'm personally having lots of fun with specs2. I tried ScalaTest as well, but I found it easier to integrated specs in my environment, which includes a few maven projects and a mix of Java and Scala projects all the time.

[]s,

2011/6/6 Aaron Novstrup <aaron [dot] novstrup [at] gmail [dot] com>
It can depend a lot on the kind of testing you need to do.

I tend to use ScalaTest with the BDD style for unit tests.  I can see
how other styles would be more useful for higher-level testing
(functional, integration, acceptance).

ScalaCheck (http://code.google.com/p/scalacheck/) supports a
completely different style of testing, which is especially useful for
testing functional programs.  It automatically generates tests based
on the input/output behavior you specify, and when tests fail, it
searches for the minimal set of inputs that can lead to failure. As
such, it is an excellent complement for Specs/ScalaTest when you need
to test functional components.

On Sun, Jun 5, 2011 at 11:59 AM, Jan Goyvaerts <java [dot] artisan [at] gmail [dot] com> wrote:
> If I'm not mistaken, many people are using ScalaTest for unit testing. But
> is it thé library to use ? Like you would for JUnit in Java.
> And if ScalaTest is the most advised for Scala, what "style"
> (http://www.scalatest.org/quick_start) are Scala developers usually
> developing in ? JUnit ? BDD ? Features ?



--
Paulo "JCranky" Siqueira
Visit my blog: http://www.jcranky.com/

Java Artisan
Joined: 2010-07-20,
User offline. Last seen 2 years 15 weeks ago.
Re: Defacto Scala unit test library ?
I'm attracted to the "textual" approach ScalaTest takes. It's very readable. Although add rather have the output formatted more carefully. 
Is that the case too for Specs2 ?

On Tue, Jun 7, 2011 at 11:26, Wille Faler <wille [dot] faler [at] gmail [dot] com> wrote:
ScalaTest and Specs2 are both excellent libraries, which one you prefer will probably be a matter of taste rather than one being "better" than the other.
Both libraries have good communities and lots of users, so are both likely to stick around.
My suggestion would be: try both and see which one you prefer, though be prepared to indecision if you do! :)
On 7 June 2011 04:26, Paulo Siqueira <paulo [dot] siqueira [at] gmail [dot] com> wrote:
I'm personally having lots of fun with specs2. I tried ScalaTest as well, but I found it easier to integrated specs in my environment, which includes a few maven projects and a mix of Java and Scala projects all the time.

[]s,

2011/6/6 Aaron Novstrup <aaron [dot] novstrup [at] gmail [dot] com>
It can depend a lot on the kind of testing you need to do.

I tend to use ScalaTest with the BDD style for unit tests.  I can see
how other styles would be more useful for higher-level testing
(functional, integration, acceptance).

ScalaCheck (http://code.google.com/p/scalacheck/) supports a
completely different style of testing, which is especially useful for
testing functional programs.  It automatically generates tests based
on the input/output behavior you specify, and when tests fail, it
searches for the minimal set of inputs that can lead to failure. As
such, it is an excellent complement for Specs/ScalaTest when you need
to test functional components.

On Sun, Jun 5, 2011 at 11:59 AM, Jan Goyvaerts <java [dot] artisan [at] gmail [dot] com> wrote:
> If I'm not mistaken, many people are using ScalaTest for unit testing. But
> is it thé library to use ? Like you would for JUnit in Java.
> And if ScalaTest is the most advised for Scala, what "style"
> (http://www.scalatest.org/quick_start) are Scala developers usually
> developing in ? JUnit ? BDD ? Features ?



--
Paulo "JCranky" Siqueira
Visit my blog: http://www.jcranky.com/


Paulo Siqueira
Joined: 2011-04-13,
User offline. Last seen 42 years 45 weeks ago.
Re: Defacto Scala unit test library ?
Based on my VERY limited experience with ScalaTest, I would say that both specs (1 and 2) and ScalaTest (Flat and BDD styles) are very similar in term of "textual" approach - and I love it on both of them.

[]s,

2011/6/7 Jan Goyvaerts <java [dot] artisan [at] gmail [dot] com>
I'm attracted to the "textual" approach ScalaTest takes. It's very readable. Although add rather have the output formatted more carefully. 
Is that the case too for Specs2 ?

On Tue, Jun 7, 2011 at 11:26, Wille Faler <wille [dot] faler [at] gmail [dot] com> wrote:
ScalaTest and Specs2 are both excellent libraries, which one you prefer will probably be a matter of taste rather than one being "better" than the other.
Both libraries have good communities and lots of users, so are both likely to stick around.
My suggestion would be: try both and see which one you prefer, though be prepared to indecision if you do! :)
On 7 June 2011 04:26, Paulo Siqueira <paulo [dot] siqueira [at] gmail [dot] com> wrote:
I'm personally having lots of fun with specs2. I tried ScalaTest as well, but I found it easier to integrated specs in my environment, which includes a few maven projects and a mix of Java and Scala projects all the time.

[]s,

2011/6/6 Aaron Novstrup <aaron [dot] novstrup [at] gmail [dot] com>
It can depend a lot on the kind of testing you need to do.

I tend to use ScalaTest with the BDD style for unit tests.  I can see
how other styles would be more useful for higher-level testing
(functional, integration, acceptance).

ScalaCheck (http://code.google.com/p/scalacheck/) supports a
completely different style of testing, which is especially useful for
testing functional programs.  It automatically generates tests based
on the input/output behavior you specify, and when tests fail, it
searches for the minimal set of inputs that can lead to failure. As
such, it is an excellent complement for Specs/ScalaTest when you need
to test functional components.

On Sun, Jun 5, 2011 at 11:59 AM, Jan Goyvaerts <java [dot] artisan [at] gmail [dot] com> wrote:
> If I'm not mistaken, many people are using ScalaTest for unit testing. But
> is it thé library to use ? Like you would for JUnit in Java.
> And if ScalaTest is the most advised for Scala, what "style"
> (http://www.scalatest.org/quick_start) are Scala developers usually
> developing in ? JUnit ? BDD ? Features ?



--
Paulo "JCranky" Siqueira
Visit my blog: http://www.jcranky.com/





--
Paulo "JCranky" Siqueira
Visit my blog: http://www.jcranky.com/

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland