- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
ScalaCheck 1.5
Created by rickynils on 2008-11-17.
Updated: 2008-11-17, 16:39
Version 1.5 of ScalaCheck is now available. ScalaCheck is a tool for automatic unit testing of your Scala and Java programs, developed by Rickard Nilsson. ScalaCheck allows you to define general properties about your code units, while the tool handles all test data generation for you: you can run thousands of unit tests automatically without writing and maintaining an endless number of test cases. ScalaCheck started out as a Scala port of the Haskell library QuickCheck, and has since evolved and been extended with features not found in Haskell QuickCheck.
Version 1.5 of ScalaCheck introduces support for Scala 2.7.2 and various minor feature additions. Please visit http://www.scalacheck.org for change history, user guide, API reference and more.
ScalaCheck's highlights
- Properties are tested automatically, with test data generated by ScalaCheck. Data generation can be precisely controlled, and generation of custom data types is simple to define.
- Failing test cases are simplified automatically, which makes pin-pointing error causes easier.
- Support for stateful testing of command sequences, and simplification of failing command sequences.
- Property objects can be tested directly from the command line without any need for special test runners. You can also control different testing parameters from the command line.
A small example, using the Scala interpreter with ScalaCheck on the path:
scala> object StringProps extends org.scalacheck.Properties("String") { | specify("startsWith", (a:String, b:String) => | (a+b).startsWith(a) | ) | specify("substring", (a:String, b:String) => | (a+b).substring(a.length) == b | ) | } defined module StringProps scala> StringProps.check + String.startsWith: OK, passed 100 tests. + String.substring: OK, passed 100 tests.
ScalaCheck links and information
- Project site
http://www.scalacheck.org
- Change history
http://code.google.com/p/scalacheck/wiki/ChangeHistory
- User Guide
http://code.google.com/p/scalacheck/wiki/UserGuide
- API documentation
http://scalacheck.googlecode.com/svn/artifacts/1.5/doc/api/index.html
- Mailing list
scalacheck [at] googlegroups.com
See http://groups.google.com/group/scalacheck for information and registration.
- Installation with sbaz
sbaz update sbaz install scalacheck
If you already have an earlier version of ScalaCheck installed, you just need to run:
sbaz upgrade
- Binary JAR
http://scalacheck.googlecode.com/files/ScalaCheck-1.5.jar
- Source JAR
http://scalacheck.googlecode.com/files/ScalaCheck-1.5-src.jar
- Source repository
http://scalacheck.googlecode.com/svn/
- Maven repository at scala-tools.org, Add this to your pom.xml:
<repositories> <repository> <id>scala-tools.org</id> <name>Scala-Tools Maven2 Repository</name> <url>http://scala-tools.org/repo-releases</url> </repository> </repositories> <dependency> <groupId>org.scalacheck</groupId> <artifactId>scalacheck</artifactId> <version>1.5</version> </dependency>
- Login or register to post comments
Printer-friendly version