Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pex and F# in Visual Studio 2010 Ultimate

I have been trying using Pex in a F# project but I have faced several issues on which I would appreciate some help:

  1. Visual Studio Pex addin worked for half an hour and not for complex project exploration.

  2. After that each time I run a Pex Exploration from within Visual Studio 2010 I get a !warning! [metadata] no explorations found after applying all filters; did you forget a [PexClass] or [PexMethod] attribute? error message. If I copy and paste the command run by visual studio when doing the exploration and remove some attributes (like sourceFilter ...) and run it from a command console then I get some generated tests. Any idea why visual studio generates an invalid command?

  3. After a while the Microsoft.Pex.Framework.dll either disappears from the .Net Reference list and I have to reference it manually using its file path or I can't even reference it any more and I have to uninstall/reinstall Pex. (A reference to C:\Program Files (x86)\Microsoft Moles\PublicAssemblie\Microsoft.Pex.Framework.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.)

All these issues don't occur when I work on a C# project.

Issues 1 2 3 occurred with the Academic version.

Using the version available for MSDN Subscriber I never got it working within visual studio (Visual Studio 2010 Ultimate NO SP1). However it worked from the command prompt. I did not face problem 3 with this version.

Has anyone managed to get Pex working with F# within visual studio ? If yes can you you tell me how you did it ? Which versions (VS and Pex) do you use ?

like image 854
Nicolas Avatar asked Nov 14 '22 19:11

Nicolas


1 Answers

I have had some success running Pex with F#. The version I used, if I believe my Downloads folder, was the academic version of Microsoft Pex and Moles 0.94.51006.1 Release for (x86). The installation file was named pex.academic.x86.msi.

I don't know if that version predates yours.

My impressions from my trials were that Pex and F# were not a very good combination: Pex insisted on creating test cases with null inputs. As generating null values in F# isn't all that common, that's typically not the scenarios in which I'm interested. Adding lots of assumptions to eliminate those just left me with Pex not being able to generate test cases. Admittedly, the functions I was testing were too complex, I still like the idea behind Pex and might try it again on smaller/easier pieces of code.

Using Pex and its GUI inside VS 2010 worked relatively fine, but not without frustration.

like image 93
Joh Avatar answered Dec 18 '22 17:12

Joh