53 lines
2.5 KiB
HTML
53 lines
2.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>QuickCheck Mini
|
|
</title>
|
|
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
|
|
</head>
|
|
<body bgcolor="white">
|
|
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
|
|
<h1>QuickCheck Mini
|
|
</h1>
|
|
<p>Copyright © Quviq AB, 2006-2010.
|
|
</p>
|
|
<p><b>Version:</b> 1.0.1
|
|
</p>
|
|
<p>
|
|
QuickCheck is a specification-based testing tool for Erlang. QuickCheck Mini is
|
|
a powerful, but restricted version of QuickCheck. It is released free of charge for
|
|
anyone interested in learning more about QuickCheck as well as for open source
|
|
developers that want to ship their code with simple QuickCheck properties.</p>
|
|
|
|
<p>In order to learn more about QuickCheck, please visit http://www.quviq.com/.
|
|
There is also a mailing list discussing QuickCheck issues, which you can subscribe to by sending an email to quickcheck-questions@quviq.com with subject "Subscribe".</p>
|
|
|
|
|
|
<h2>QuickCheck</h2>
|
|
|
|
Programs
|
|
are tested by writing <i>properties</i> in the source code, such as
|
|
<pre>
|
|
prop_reverse() ->
|
|
?FORALL(Xs,list(int()),
|
|
lists:reverse(lists:reverse(Xs)) == Xs).
|
|
</pre>
|
|
Properties are tested by calling
|
|
<pre>
|
|
eqc:quickcheck(prop_reverse())
|
|
</pre><p>
|
|
which generates 100 random test cases and checks that the property
|
|
returns <tt>true</tt> in every case.</p>
|
|
|
|
<p>
|
|
Functions for writing properties are found in module <a href="eqc.html"><code>eqc</code></a>,
|
|
while functions for writing test data generators (such as
|
|
<tt>list(int())</tt> above) are found in module <a href="eqc_gen.html"><code>eqc_gen</code></a>. Parts
|
|
of the interface are provided via macros, which are defined in
|
|
<tt>eqc.hrl</tt>--this file should be included in every module which
|
|
uses QuickCheck. This header file also imports much of the QuickCheck
|
|
API, so it can be used without explicit module names.
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
|
|
<p><i>Generated by EDoc, Jun 13 2010, 13:15:30.</i></p>
|
|
</body>
|
|
</html>
|