Movatterモバイル変換


[0]ホーム

URL:


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

Home

Scala Main Menu

Home » ScalaCheck 1.5

ScalaCheck 1.5

Created by rickynils on 2008-11-17. Updated: 2008-11-17, 16:39

Version 1.5 ofScalaCheck 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 visithttp://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 StringPropsscala> StringProps.check+ String.startsWith: OK, passed 100 tests.+ String.substring: OK, passed 100 tests.

ScalaCheck links and information

sbaz updatesbaz install scalacheck

If you already have an earlier version of ScalaCheck installed, you just need to run:

sbaz upgrade
<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>

 

Scala Quick Links

Featured News

User login


will be sent securely

Create new account

Retrieve lost password

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


[8]ページ先頭

©2009-2025 Movatter.jp