NEW: Code Digger for Visual Studio 2012 and 2013 is a lightweight version of Pex that allows you to explore public .NET methods in Portable Class Libraries directly from the code editor. Under the hood, Code Digger uses the Pex engine.
Pex and Moles are Visual Studio 2010 Power Tools that help Unit Testing .NET applications.
Pex automatically generates test suites with high code coverage. Right from the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications.
Moles allows to replace any .NET method with a delegate. The Fakes Framework in Visual Studio 2012 is the next generation of Moles & Stubs, and will eventually replace it. Moles supports unit testing by providing isolation by way of detours and stubs. The Moles framework is provided with Pex, or can be installed by itself as a Microsoft Visual Studio add-in.
The Fakes Framework in Visual Studio 2012 is the next generation of Moles & Stubs. Fakes is different from Moles, however, so moving from Moles to Fakes will require some modifications to your code. A guide for this migration will be available at a later date. Moles will not be developed further, so we recommend to migrate to Fakes.
Code Digger for Visual Studio 2013 and 2013 is a lightweight version of Pex that allows you to explore public .NET methods in Portable Libraries directly from the code editor.
Code Digger is the first extension from the Pex and Moles Team at Microsoft Research for Visual Studio 2012 and 2013. Stay tuned for future extensions that bring more aspects of the rich experience of the Pex Visual Studio 2010 Power Tools to the latest version of Visual Studio. If you have feedback for us, or bug reports, feel free to write an email to the Pex team at Microsoft Research. If you have used Pex before, let us know if you are missing a particular feature.
Thanks for your support, The Pex and Moles Team.
Try it out on the web: www.pexforfun.com
Pex for fun on the web is a radically simplified version of the fully featured Pex Power Tool for Visual Studio. You do not need to install anything; all the work happens in the cloud. You can write code in C#, Visual Basic, or F#. Go to www.pexforfun.com, which comes with a set of code puzzles. Then click on the “Ask Pex!” button to get the answer yourself. Share your puzzles with your friends. Click Learn to start tutorials.
Want to know more?
- Watch the Channel9 'Getting Start with Moles' video
- Watch the Channel9 'Getting Started with Pex' video
- Watch the Channel9 Pex and Code Contracts video (french)
- Watch the Channel9 Pex - Automated White box Testing video
- Watch the 5 hours workshop on Pex and Moles (part 1, 2 ,3)
- Watch the PDC 2010 talk [2009, 2008]
- Watch the Channel9 Pex for SharePoint video
- Read more documentation
Pex in the news and blogs
- June 9, 2013: Fabio Gouw on Pex no Visual Studio 2012: Code Digger e TDD com teorias
- April 25, 2013: Rion Williams on Using Pex and Microsoft Code Digger to Better Understand and Test Your Code
- Aril 25, 2013: Mike James on Code Digger Finds The Values That Break Your Code
- April 1, 2013: Maurizio Pianfetti on TOOLS FOR TEST GENERATION IN BLACK-BOX AND WHITE-BOX TESTING (in Italian)
- February 11, 2013: Visual Studio ALM + Team Foundation Server Blog announced Fakes now available in Visual Studio Premium
- November 26, 2012: Dino Esposito at Dr. Dobb's on Pex: Microsoft Research's Unit Test Generator and Evaluator
- October 2, 2012: Jan Fajfr on Introduction to Fakes and migration from Moles
- April 26, 2011: Jan Fajfr on Pex & Moles - Testing business layer
- February 22, 2011: Pex and Visual Studio in MSDN UK Team blog
- February 15, 2011: Bill Wagner on A fun brain exercise: PexForFun
- October 25, 2010: Pex and Pex for fun article in print magazine c't 23/2010, page 48 (in German)
- August 15, 2010: LaM on Microsoft Pex – Automated Unit Testing
- August 2, 2010: Flexing Pex on the SD Times
- July 15, 2010: A BinaryThought on Pex Power Tools
- May 18, 2010: Assaf Stone on TDD: It Doesn’t Have to Be So Difficult using Pex and Moles (+ slides and demo code)
- May 10, 2010: Fernando Machado Píriz has a screencast on Unit Tests generation with Pex using Visual Studio 2010 and C# 4.0 (spanish)
- May 7, 2010: Fernando Machado Píriz writes about Pex and Contracts: Better together (also in Spanish)
- May, 2010: Programmez.com (french journal) features a 2 page article on Pex (in French)
- May 5, 2010: Søren Trudsø and Kenneth Egholm did a comparison of Pex and black-box testing (PDF)
- April 29, 2010: Thomas Weller shows how to use Moles with Gallio
- April 23, 2010: Mathias Brandewinder shares the Joy of Pex (with slides)
- April 19, 2010: Rickard Nilsson isolates from Asp.NET with Moles
- April 14, 2010: Stephen Schaff is "mocking the Un-Mockable" (screencast)
- April 12, 2010: Joydip Kanjilal on Working with Microsoft PEX Framework in Dr Dobbs
- April 10, 2010: Peter Himschoot on Pex and Code Contracts
- April 8, 2010: Nick Walker is looking at moles (several posts)
- April 1, 2010: Didier Caron uses Moles and Pex to test a Twitter connector.
- March 29, 2010: The Moss Show interview on Pex and Moles for SharePoint
- March 27, 2010: Bnaya Eshet gives a walktrough of Pex
- March 26, 2010: Microsoft DPE Spain releases a DDD N-Layer Architecture project that uses Pex and Moles for unit testing
- March 26, 2010: Bnaya Eshet walks uses Moles to test logic depending on time
- March 11, 2010: Martin Rue digs code with Moles
- March 10, 2010: Kiran Lakhotia publishes an extension of Pex on CodePlex enabling better constraint solving of floating point constraints
- March 8, 2010: Kristofer Liljeblad uses Moles to test a web service
- March 1, 2010: Tim Mahy uses Moles to isolate from the System.IO dependencies
- February 20, 2010: Brett Daniel, Tihomir Gvero, Darko Marinov On Test Repair using Symbolic Execution, using Pex for their research experiments
- February 17, 2010: Jason Bock unveils the AutoPex project on CodePlex.
- February 8, 2010: Pex is demoed at the plenary session in TechDays Paris!
- February 2, 2010: Dave Bending gives an overview of Pex
- February 1, 2010: Dominick Baier uses Moles to test security code
- January 27, 2010: Rafael Flores talks about TDD and Pex (in Spanish)
- January 21, 2010: Martin W. Angler applies Pex and Moles to untestable code
- January 15, 2010: Martin W. Angler has detailled post on First steps with Pex
- January 5, 2010: Naveen explores Code Contracts, Pex and F# together
- December 17, 2009: Code Contracts 'et' Pex in french on Channel9
- December 15, 2009: Interview with Jeffrey Van Gogh on how the Reactive Extensions use Pex for testing.
- December 7, 2009: João Angelo on Unit Testing With NUnit and Moles
- December, 2009: Nikhil Sachdeva published an MSDN article on Automated Unit Tests for Legacy Code with Pex
- December 1, 2009: Eric Nelson publishes a podcast recorded at TechEd Europe
- November 18, 2009: Sasha Goldshtein writes on PDC 2009 Day 1: Code Contracts and Pex: Power Charge Your Assertions and Unit Tests
- November 12, 2009: Abdulla AbdelHaq talks to the Jordan .NET User Group: PEX - Let me fix your code for you (in Arabic).
- November 11, 2009: Eric Nelson: Did you know Microsoft makes a mocking tool? And TechEd Europe 2009 Highlights and Lowlights.
- October 19, 2009: Yauhen Safrankou shows how to build a custom test naming convention.
- October 12, 2009: Nikolai Tillmann and Peli de Halleux demoed Pex on DNR! TV.
- October 11, 2009: Yauhen Safrankou talks about generating Stubs through MSBuild
- October 4, 2009: Andrew Kazyrevich compares the mock frameworks for .NET, including Moles.
- October 1, 2009: Jason Bock publishes his What Will Pex do? materials.
- September 22, 2009: InfoQ writes Microsoft releases a new version of Pex, providing better support to testing (in simplified Chinese)
- August 26, 2009: Steve Andrews has a "Pop Quiz: .NET Integers, Unit Testing, and Boundary Checking"
- August 11, 2009: Marvin Steppat announces that "codekicker.BBCode ist open source" (in German), a library tested with Pex and in production use at the German developer community site codekicker.de
- August 10, 2009: Alkampfer tells a tale of "Using Pex in more complex environment"
- July 6, 2009: Andrew Kazyrevich on "Introduction to Pex Stubs"
- June 16, 2009: Alkampfer on "Pex to the rescue"
- June 4/8, 2009: Unai Zorrilla gives Channel9 movies on "Introduccion a Pex" and "Introduccion a Stubs" (in Spanish - courtesy of Daniel Garzon)
- June 1, 2009: Barton Friedland on "Software I am excited about"
- June, 2009: Thomas Reinwart writes on "Pex - automatisches white box testen mit .net" in the Austrian PCNews (in German)
- May 26, 2009: John Smith Flex Your Pex! series (Part 1, 2, 3, 4)
- May 10, 2009: Damic Dobric presentation on Contracts and Pex
- May 2, 2009: Jamie Philips walks through using Pex, Stubs and DI
- April 26, 2009: Andrew Kazyrevich compares the performance of Stubs with other mock frameworks
- April 16, 2009: Muntedhar Alhakim gives a short introduction on Pex
- April 13, 2009: Damir Dobric on "Using of Factory in Pex" and tracing condition paths
- February 26, 2009: Mathew Podwysocki tests functional folds with Pex
- February 14, 2009: Damir Dobric on allowing exceptions
- January 16, 2009: Maarten Balliauw on "Verifying and Testing code with Pex"
- January 11, 2009: Gary Evans on "Theory Driven Development"
- January 11, 2009: Willy-Peter Schaub on "Pex.. a small package of dynamite"
- January 6, 2009: "Monster Got my .NET" on "Pex and IoC - A struggle with code", "Pex - Software cracker?" and "Pex saw it coming"
- November 22, 2008: Ben Hall speaks on "Pex the future of unit testing?" at DDD7
- November 20, 2008: Adam Breindel on "Pex moves the needle big time on Software testing..."
- October 22, 2008: David Lambert on "Pex: Unit Testing++"
- July 2008: Alexander Nowak Pex Chronicles series (Part 1,2,3,4,5,6,6 revisited,6 revisited again,7)
- June 1, 2008: Stanislav Dvoychenko on why use Pex
- February 05, 2008: Bil Simser on "Pex: A tool in search of identity"
- January 1, 2008: Hanselminutes on Pex
Your post is not in the list? Drop us a link.
Where are the MSDN forums?
We have decided to migrate our forums to stackoverflow.com in order to better build a community around Pex and Moles. Questions about Pex should be tagged with 'Pex' and Moles with 'Moles'...