<p>For example, <a href="http://reductiotest.org/" rel="nofollow noreferrer">Reductio</a> (for Java/Scala) and <a href="http://www.cs.chalmers.se/~rjmh/QuickCheck/" rel="nofollow noreferrer">QuickCheck</a> (for Haskell).  The kind of framework I'm thinking of would provide "generators" for built-in data types and allow the programmer to define new generators.  Then, the programmer would define a test method that asserts some property, taking variables of the appropriate types as parameters.  The framework then generates a bunch of random data for the parameters, and runs hundreds of tests of that method.</p>

<p>For example, if I implemented a Vector class, and it had an add() method, I might want to check that my addition commutes.  So I would write something like (in pseudocode):</p>

<pre><code>boolean testAddCommutes(Vector v1, Vector v2) {
    return v1.add(v2).equals(v2.add(v1));
}
</code></pre>

<p>I could run testAddCommutes() on two particular vectors to see if that addition commutes.  But instead of writing a few invocations of testAddCommutes, I write a procedure than generates arbitrary Vectors.  Given this, the framework can run testAddCommutes on hundreds of different inputs.</p>

<p>Does this ring a bell for anyone?</p>

[{'answer_id': 77720, 'author': 'Adam Driscoll', 'author_id': 13688, 'author_profile': 'https://Stackoverflow.com/users/13688', 'pm_score': -1, 'selected': False, 'text': '<p>I might not understand you correctly but check this out...</p>\n\n<p><a href="http://www.ayende.com/projects/rhino-mocks.aspx" rel="nofollow noreferrer">http://www.ayende.com/projects/rhino-mocks.aspx</a></p>\n'}, {'answer_id': 79139, 'author': 'Alan', 'author_id': 9916, 'author_profile': 'https://Stackoverflow.com/users/9916', 'pm_score': 1, 'selected': False, 'text': '<p>I may not understand correctly either, but <a href="http://www.codeplex.com/Pex" rel="nofollow noreferrer">PEX</a> may be of use to you.</p>\n'}, {'answer_id': 1542844, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>There\'s FsCheck, a port from QuickCheck to F# and thus C#, although most of the doc seems to be for f#.\nI\'ve been exploring the ideas myself aswell. see : <a href="http://kilfour.wordpress.com/2009/08/02/testing-tool-tour-quicknet-preview/" rel="nofollow noreferrer">http://kilfour.wordpress.com/2009/08/02/testing-tool-tour-quicknet-preview/</a></p>\n'}, {'answer_id': 1580698, 'author': 'kilfour', 'author_id': 191485, 'author_profile': 'https://Stackoverflow.com/users/191485', 'pm_score': 1, 'selected': False, 'text': '<p>to elaborate on my previous remark, the QN code to test the pseudo-code example would look something like this :</p>\n\n<pre>\nnew TestRun(1, 1000)\n    .AddTransition(new MetaTransition&lt;Input&lt;Vector, Vector&gt;, Vector&gt;\n    {\n        Name = "Vector Add ",\n        Generator = DoubleVectorGenerator,\n        Execute = input => input.paramOne.Add(input.paramTwo)\n    }\n    .RegisterProperty(\n        (input, output) =>\n            new QnProperty(\n                "Is Communative",\n                () => QnAssert.IsTrue(output == input.paramTwo.Add(input.paramOne) )\n            )\n        )\n    )\n    .Verify()\n    .RethrowLastFailureifAny()\n    .ReportPropertiesTested(new ConsoleReporter());\n</pre>\n\n<p>where DoubleVectorGenerator is a userdefined class supplying values of the type Input&lt;Vector, Vector&gt;.</p>\n'}]
['https://Stackoverflow.com/questions/77683', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14113/']