<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>FsCheck: A random testing framework</title><link>http://fscheck.codeplex.com/project/feeds/rss</link><description>FsCheck is a tool for testing .NET programs automatically. The programmer provides a specification of the program, in the form of properties which the program should satisfy, and FsCheck then tests that the properties hold in a large number of randomly generated cases.</description><item><title>New Post: Unable to run C# NUnit examples</title><link>http://fscheck.codeplex.com/discussions/439323</link><description>&lt;div style="line-height: normal;"&gt;The answer was buried in the NUnit documentation and the Resharper options screen. I had to copy FsCheck.NUnit.Addin.dll to the appropriate bin/addins directory. On my machine, that was at C:\Program Files (x86)\JetBrains\ReSharper\v7.1\Bin\addins. I had to create the addins directory there myself. It seems like a similar procedure should work for the standalone test runner but I couldn't get it to work.&lt;br /&gt;
&lt;br /&gt;
I also changed a Resharper setting; not sure if it's necessary or not:&lt;br /&gt;
Resharper -&amp;gt; Options -&amp;gt; Tools -&amp;gt; Unit Testing -&amp;gt; NUnit -&amp;gt; Load NUnit Addins -&amp;gt; Always&lt;br /&gt;
&lt;/div&gt;</description><author>brianhv</author><pubDate>Sat, 06 Apr 2013 01:42:48 GMT</pubDate><guid isPermaLink="false">New Post: Unable to run C# NUnit examples 20130406014248A</guid></item><item><title>New Post: Unable to run C# NUnit examples</title><link>http://fscheck.codeplex.com/discussions/439323</link><description>&lt;div style="line-height: normal;"&gt;I downloaded the zipfile with the current source tree and successfully built it in VS 2012. However, the tests in the FsCheck.NUnit.CSharpExamples project fail in both the ReSharper test runner and in the NUnit GUI. In both cases, all three tests fail with the message &amp;quot;Test method has non-void return type, but no result is expected.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Is there something else I need to do to get this to work?&lt;br /&gt;
&lt;/div&gt;</description><author>brianhv</author><pubDate>Sat, 06 Apr 2013 01:04:26 GMT</pubDate><guid isPermaLink="false">New Post: Unable to run C# NUnit examples 20130406010426A</guid></item><item><title>Source code checked in, #6fc5a7cf6a68</title><link>http://fscheck.codeplex.com/SourceControl/changeset/changes/6fc5a7cf6a68</link><description>Add more accurate Replay test.&amp;#10;Also checks whether the reported seed is the same as the input seed.</description><author>Kurt Schelfthout</author><pubDate>Thu, 28 Mar 2013 15:59:24 GMT</pubDate><guid isPermaLink="false">Source code checked in, #6fc5a7cf6a68 20130328035924P</guid></item><item><title>Source code checked in, #28992e7b6c48</title><link>http://fscheck.codeplex.com/SourceControl/changeset/changes/28992e7b6c48</link><description>Add Replay property to PropertyAttribute for easier replay&amp;#47;debug of failed test</description><author>Kurt Schelfthout</author><pubDate>Wed, 27 Mar 2013 17:32:26 GMT</pubDate><guid isPermaLink="false">Source code checked in, #28992e7b6c48 20130327053226P</guid></item><item><title>Source code checked in, #f11a27ac51d8</title><link>http://fscheck.codeplex.com/SourceControl/changeset/changes/f11a27ac51d8</link><description>Add possibility to put ArbitraryAttribute on enclosing module in Xunit.&amp;#10;This makes it easier to use the same generators for a whole bunch of tests grouped in a module.</description><author>Kurt Schelfthout</author><pubDate>Mon, 25 Mar 2013 20:15:09 GMT</pubDate><guid isPermaLink="false">Source code checked in, #f11a27ac51d8 20130325081509P</guid></item><item><title>Created Issue: PropertyAttribute: Search for Arb override on the module level too [16799]</title><link>http://fscheck.codeplex.com/workitem/16799</link><description>Avoids having to set Arbitrary on each PropertyAttribute&lt;br /&gt;</description><author>kurt2001</author><pubDate>Thu, 21 Mar 2013 13:23:05 GMT</pubDate><guid isPermaLink="false">Created Issue: PropertyAttribute: Search for Arb override on the module level too [16799] 20130321012305P</guid></item><item><title>Created Issue: Add possibility to run with seed to PropertyAttribute [16798]</title><link>http://fscheck.codeplex.com/workitem/16798</link><description>So users can just copy-paste the printed seed into the attribute and run with that&lt;br /&gt;</description><author>kurt2001</author><pubDate>Thu, 21 Mar 2013 13:22:07 GMT</pubDate><guid isPermaLink="false">Created Issue: Add possibility to run with seed to PropertyAttribute [16798] 20130321012207P</guid></item><item><title>Source code checked in, #2213c345eb0f</title><link>http://fscheck.codeplex.com/SourceControl/changeset/changes/2213c345eb0f</link><description>Add Gen.sample</description><author>Kurt Schelfthout</author><pubDate>Thu, 17 Jan 2013 03:12:44 GMT</pubDate><guid isPermaLink="false">Source code checked in, #2213c345eb0f 20130117031244A</guid></item><item><title>Created Issue: Support generation of arbitrary Decimal values [16797]</title><link>http://fscheck.codeplex.com/workitem/16797</link><description>FSCheck.Arb.Default is missing the Arbitrary&amp;#60;Decimal&amp;#62; member.&lt;br /&gt;</description><author>empeak</author><pubDate>Wed, 02 Jan 2013 07:15:34 GMT</pubDate><guid isPermaLink="false">Created Issue: Support generation of arbitrary Decimal values [16797] 20130102071534A</guid></item><item><title>New Post: Infinite loop on impossible gen constraints</title><link>http://fscheck.codeplex.com/discussions/407224</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;It may be useful to have a live example of a custom gen that can generate an infinite loop.&lt;/p&gt;
&lt;p&gt;https://github.com/jackfoxy/RandomBitsSolution/blob/master/RandomBitsTest/FsCheckTest.fs&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;let&lt;/span&gt; rndByteSeqGen = 
    gen {
&lt;span style="color:green"&gt;//        let! inclLower = Arb.generate  //http://fscheck.codeplex.com/workitem/16796&lt;/span&gt;
        &lt;span style="color:blue"&gt;let&lt;/span&gt;! inclLower = Gen.suchThat (fun x -&amp;gt; x &amp;lt; System.Byte.MaxValue) Arb.generate
        &lt;span style="color:blue"&gt;let&lt;/span&gt;! exlUpper = Gen.suchThat (fun x -&amp;gt; x &amp;gt; inclLower) Arb.generate
        &lt;span style="color:blue"&gt;let&lt;/span&gt;! count = Gen.suchThat (fun x -&amp;gt; x &amp;gt;= 1) Arb.generate
        &lt;span style="color:blue"&gt;let&lt;/span&gt; x = &lt;span style="color:blue"&gt;new&lt;/span&gt; RandomBits(&lt;span style="color:#a31515"&gt;&amp;quot;7816001122100133&amp;quot;&lt;/span&gt;)
        &lt;span style="color:blue"&gt;return&lt;/span&gt; (x.RndByteSeq (inclLower, exlUpper, count) |&amp;gt; List.ofSeq), (inclLower, exlUpper, count) 
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;inclLower is the inclusive lower bound and exlUpper is the exclusive upper bound for generation of a random sequence of bytes. If inclLower generates&amp;nbsp;System.Byte.MaxValue, then exlUpper can never be generated. This will happen on nearly half of the
 generation attempts.&lt;/p&gt;
&lt;/div&gt;</description><author>jackfoxy</author><pubDate>Tue, 18 Dec 2012 20:51:34 GMT</pubDate><guid isPermaLink="false">New Post: Infinite loop on impossible gen constraints 20121218085134P</guid></item><item><title>Closed Issue: arbitrary infinite loop [16796]</title><link>http://fscheck.codeplex.com/workitem/16796</link><description>I have a custom generator which appears to go into an infinite loop between the suchThatOption let binding in Gen.fs and stdRange &amp;#47; stdNext in Random.fs about half the time, and works successfully about half the time.  Does this sound like a known issue&amp;#63; &lt;br /&gt;Comments: Interesting case - there is a warning that an infinite loop can happen if a suchThat does not get &amp;#34;enough&amp;#34; good values, but if you are generating a generator, then it indeed becomes more meta than that &amp;#58;&amp;#41;</description><author>kurt2001</author><pubDate>Mon, 17 Dec 2012 18:19:07 GMT</pubDate><guid isPermaLink="false">Closed Issue: arbitrary infinite loop [16796] 20121217061907P</guid></item><item><title>Commented Issue: arbitrary infinite loop [16796]</title><link>http://fscheck.codeplex.com/workitem/16796</link><description>I have a custom generator which appears to go into an infinite loop between the suchThatOption let binding in Gen.fs and stdRange &amp;#47; stdNext in Random.fs about half the time, and works successfully about half the time.  Does this sound like a known issue&amp;#63; &lt;br /&gt;Comments: I solved the situation. after posting this. I was generating one of the parameters in my custom generator without constraints, and it was possible to generate this parameter so that a subsequent suchThat constraint would be impossible to solve. My back of the envelope calculation predicts this situation should occur in nearly half the runs, which was consistent with my experience.&amp;#10;&amp;#10;I think somewhere in the documentation it may mention this situation, but now I have proven for sure if a custom generator can generate unsovleable combinations it will loop.</description><author>jackfoxy</author><pubDate>Mon, 17 Dec 2012 17:42:39 GMT</pubDate><guid isPermaLink="false">Commented Issue: arbitrary infinite loop [16796] 20121217054239P</guid></item><item><title>Created Issue: arbitrary infinite loop [16796]</title><link>http://fscheck.codeplex.com/workitem/16796</link><description>I have a custom generator which appears to go into an infinite loop between the suchThatOption let binding in Gen.fs and stdRange &amp;#47; stdNext in Random.fs about half the time, and works successfully about half the time.  Does this sound like a known issue&amp;#63; &lt;br /&gt;</description><author>jackfoxy</author><pubDate>Mon, 17 Dec 2012 03:21:48 GMT</pubDate><guid isPermaLink="false">Created Issue: arbitrary infinite loop [16796] 20121217032148A</guid></item><item><title>New Post: Typeclasses</title><link>http://fscheck.codeplex.com/discussions/405907</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, in fact I have! There are two main uses of typeclasses in FsCheck. For one of them, I have considered replacing the current (runtime) implementation with an implementation at compile time. For the other one, I don't think it makes sense.&lt;/p&gt;
&lt;p&gt;Use 1: map from type to a default generator for the type. I think using a static overloading mechanism here is not idiomatic, as it takes useful functionality away - the ability to change default generators for types at runtime. Two important use cases are
 - (1) specifying a number of generators scoped to a bunch of test methods, and (2) overriding a particular generator while keeping the default generator for the aggregate type. Say you have a record type (int, string, string, double), and you are fine with
 the default int and double generator but don't want empty strings. You can then just override the string generator, and keep using the default (reflection-based) generator for the record type. With static overloading you'd have to rewrite the record type generator,
 which is pretty tedious. Also you end up wrapping primitive types a lot to take care of special cases (NonEmptyString, NonZeroDouble, etc).&lt;/p&gt;
&lt;p&gt;To sum up, I think making the whole thing dynamic has some benefits that outweigh the cost (i.e. no type safety so&amp;nbsp;occasionally annoying errors)&amp;nbsp;. I have tried to remedy the latter a bit by having lots of debug output when you override generators (it says
 what generators it adds, which ones it overrides, etc).&lt;/p&gt;
&lt;p&gt;Use 2: map from result type of a test to a Testable (e.g. for unit the test fails it doesn't thrown an exception, for boolean if it returns true, etc). At one point I started refactoring that to the approach you mentioned, but as I remember I ran into ordering
 issues, it became unwieldy, and compilation became pretty slow pretty quickly. I am unsure if the latter would carry over to FsCheck users (I suspect not). In the end I gave up somewhere halfway through because since this use case is effectively completely
 contained inside FsCheck, it doesn't bring much to the table for users. It would however get rid of some initialization problems that can&amp;nbsp;potentially&amp;nbsp;still happen.&lt;/p&gt;
&lt;p&gt;It's an interesting technique.&lt;/p&gt;
&lt;p&gt;Hope that makes sense!&lt;/p&gt;
&lt;p&gt;Best, Kurt&lt;/p&gt;
&lt;/div&gt;</description><author>kurt2001</author><pubDate>Fri, 07 Dec 2012 12:55:32 GMT</pubDate><guid isPermaLink="false">New Post: Typeclasses 20121207125532P</guid></item><item><title>New Post: Typeclasses</title><link>http://fscheck.codeplex.com/discussions/405907</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi, I wonder if you have considered using a technique like&amp;nbsp;https://code.google.com/p/fsharp-typeclasses/ to implement typeclasses in FsCheck.&lt;/p&gt;
&lt;p&gt;I know this would be a pretty big change, perhaps not worth the effort. But it's definitely a closer approximation to Haskell's typeclasses (e.g. type-safe, no reflection).&lt;/p&gt;
&lt;p&gt;So basically, just trying to pick your brain about the potential pros and cons of this hypothetical change :)&lt;/p&gt;
&lt;p&gt;For example, it would seem to make it harder to infer generators via reflection for discriminated unions.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Mauricio&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>mausch</author><pubDate>Fri, 07 Dec 2012 02:56:23 GMT</pubDate><guid isPermaLink="false">New Post: Typeclasses 20121207025623A</guid></item><item><title>Commented Feature: Port and integrate smallcheck [11859]</title><link>http://fscheck.codeplex.com/workitem/11859</link><description>Smallcheck &amp;#91;1&amp;#93; is another testing framework for Haskell, that generates an exhaustive combination of values for properties. It may be possible to integrate this exhaustive generation with FsCheck. For example, it could be used to generate the &amp;#34;smallest&amp;#34; value for which a property fails, by first testing randomly and moving to exhaustive testing if a test fails. And it may be useful for some niche scenarios where the number of combinations is very small anyway.&lt;br /&gt;&lt;br /&gt;&amp;#91;1&amp;#93;http&amp;#58;&amp;#47;&amp;#47;hackage.haskell.org&amp;#47;cgi-bin&amp;#47;hackage-scripts&amp;#47;package&amp;#47;smallcheck&lt;br /&gt;Comments: Looks good. Have fun&amp;#33;</description><author>kurt2001</author><pubDate>Fri, 09 Nov 2012 01:31:48 GMT</pubDate><guid isPermaLink="false">Commented Feature: Port and integrate smallcheck [11859] 20121109013148A</guid></item><item><title>Commented Feature: Port and integrate smallcheck [11859]</title><link>http://fscheck.codeplex.com/workitem/11859</link><description>Smallcheck &amp;#91;1&amp;#93; is another testing framework for Haskell, that generates an exhaustive combination of values for properties. It may be possible to integrate this exhaustive generation with FsCheck. For example, it could be used to generate the &amp;#34;smallest&amp;#34; value for which a property fails, by first testing randomly and moving to exhaustive testing if a test fails. And it may be useful for some niche scenarios where the number of combinations is very small anyway.&lt;br /&gt;&lt;br /&gt;&amp;#91;1&amp;#93;http&amp;#58;&amp;#47;&amp;#47;hackage.haskell.org&amp;#47;cgi-bin&amp;#47;hackage-scripts&amp;#47;package&amp;#47;smallcheck&lt;br /&gt;Comments: Hi &amp;#10;I&amp;#39;ve recently started porting SmallCheck to F&amp;#35;. &amp;#10;You may check out http&amp;#58;&amp;#47;&amp;#47;smallcheck.codeplex.com for more details.&amp;#10;</description><author>alex_bogomaz</author><pubDate>Thu, 08 Nov 2012 12:53:58 GMT</pubDate><guid isPermaLink="false">Commented Feature: Port and integrate smallcheck [11859] 20121108125358P</guid></item><item><title>New Post: Generating data for use outside of FsCheck</title><link>http://fscheck.codeplex.com/discussions/400002</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I'll take a look at that, thanks. I still think sample is very cool. I wanted to use FsCheck as a data generator on another project, but could not figure out how to do it. Now I can use FsCheck to generate data for any purpose.&lt;/p&gt;&lt;/div&gt;</description><author>jackfoxy</author><pubDate>Sat, 20 Oct 2012 00:15:21 GMT</pubDate><guid isPermaLink="false">New Post: Generating data for use outside of FsCheck 20121020121521A</guid></item><item><title>New Post: Generating data for use outside of FsCheck</title><link>http://fscheck.codeplex.com/discussions/400002</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Unfortunately this is not enough for me to properly debug.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Try overriding ToString() in the implementation of&amp;nbsp;&lt;span&gt;PhysicistQueue, or switch to a record type.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;I would like to step into one of the failing cases with the debugger, but how do I break into a failing case and not a successful case?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You could use&amp;nbsp;System.Diagnostics.Debugger.Break() when the equality test returns false.&lt;/p&gt;&lt;/div&gt;</description><author>mausch</author><pubDate>Sat, 20 Oct 2012 00:11:04 GMT</pubDate><guid isPermaLink="false">New Post: Generating data for use outside of FsCheck 20121020121104A</guid></item><item><title>New Post: Generating data for use outside of FsCheck</title><link>http://fscheck.codeplex.com/discussions/400002</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I've only started using FsCheck, so likely I am missing something. Here is my use case for sample. Some of my problem stemmed from not understanding FsCheck well enough.&amp;nbsp;My original fsCheck code was failing:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;fsCheck "PhysicistQueue" (Prop.forAll (Arb.fromGen physicistQueueIntGen)&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;(fun (q, l) -&amp;gt; q :?&amp;gt; PhysicistQueue&amp;lt;int&amp;gt; |&amp;gt; PhysicistQueue.rev |&amp;gt; PhysicistQueue.rev |&amp;gt; Seq.toList = (q |&amp;gt; Seq.toList) |&amp;gt; classifyCollect q q.Length))&lt;/p&gt;
&lt;p&gt;...and showing me my generated tuple&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;FSharpx.DataStructures.Tests.IQueueTest.reverse . reverse = id:PhysicistQueue-Falsifiable, after 2 tests (0 shrinks) (StdGen (2139253415,295630954)):(seq [0; 0; 1; 2; ...], [0; 0; 1; 2; -1])&lt;/p&gt;
&lt;p&gt;Unfortunately this is not enough for me to properly debug. I would like to step into one of the failing cases with the debugger, but how do I break into a failing case and not a successful case?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Anyway, sample lets me do this:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; let y = sample 100 physicistQueueIntGen&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; //so I can set a breakpoint after a failure&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; let rec loop l =&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; match l with&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | [] -&amp;gt; ()&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ((q : IQueue&amp;lt;int&amp;gt;), (l' : int list))::tl -&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let qList = q :?&amp;gt; PhysicistQueue&amp;lt;int&amp;gt; |&amp;gt; PhysicistQueue.rev |&amp;gt; PhysicistQueue.rev |&amp;gt; Seq.toList&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (qList = l')&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then loop tl&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else loop tl&lt;br /&gt;&amp;nbsp; &amp;nbsp; loop y&lt;/p&gt;&lt;/div&gt;</description><author>jackfoxy</author><pubDate>Fri, 19 Oct 2012 23:51:20 GMT</pubDate><guid isPermaLink="false">New Post: Generating data for use outside of FsCheck 20121019115120P</guid></item></channel></rss>