Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Digging into your code with the free Microsoft Code Digger and the power of Pex

Have Visual Studio 2012?

Building Portable Libraries?

Wonder what all the weird and wild code paths your code might have, but it hurts your brain to try to write every possible path in your unit tests?

Want a free extension that throws everything at your code, but the kitchen sink? (though I think that's an option too... Wink

Introducing: Code Digger, an extension for VS2012

Today, the Pex team at Microsoft Research (Nikolai Tillmann and Peli de Halleux) is happy to announce that Code Digger, an extension for Visual Studio 2012, has shipped to the Visual Studio Gallery. After shipping the Moles framework as Fakes in Visual Studio 2012, this is the next step of bringing our research projects to the latest and greatest development environment

...

What is Code Digger?

Code Digger generates interesting values that show different behaviors of your .NET code. The result is a table showing for which inputs your code produces which outputs.

What is the relation between Pex and Code Digger?

Under the hood, Code Digger uses the Pex engine and Microsoft Research’s Z3 constraint solver to systematically analyze all branches in the code, trying to generate a test suite that achieves high code coverage. Working together with Peter Provost from the Visual Studio product group, we tried to create a really simple user interface. We want to bring the idea of code exploration to every programmer’s fingertips. This is different from the Pex Power Tools where we gave you many options to configure, and you had to embrace the idea of (Parameterized) Unit Testing to get all benefits. Code Digger is not a full replacement of Pex, it is merely the first extension that the Pex team ships for Visual Studio 2012 – stay tuned for more.

Limitations

Code Digger only works on public .NET code that resides in Portable Class Libraries.

By restricting the code exploration to Portable Class Libraries, we avoid problems with code that has dependencies on a particular platform which the Pex engine does not understand.

...

Microsoft Code Digger

Overview

Code Digger analyzes possible execution paths through your .NET code. The result is a table where each row shows a unique behavior of your code. The table helps you understand the behavior of the code, and it may also uncover hidden bugs.

Through the new context menu item "Generate Inputs / Outputs Table" in the Visual Studio editor, you can invoke Code Digger to analyze your code. Code Digger computes and displays input-output pairs. Code Digger systematically hunts for bugs, exceptions, and assertion failures.

Code Digger only works on public .NET code that resides in Portable Class Libraries.

Under the hood, Code Digger uses the Pex engine and Microsoft Research’s Z3 constraint solver to systematically analyze all branches in the code, trying to generate a test suite that achieves high code coverage.

Code Digger is the first extension from the Pex team at Microsoft Research for Visual Studio 2012. 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.

To stay up-to-date, like Pex and Moles on Facebook.

...

Walkthrough

After you have installed the Code Digger extension for Visual Studio 2012, create a “Portable Class Library” project.

...

Write some public code, right-click on it, and select “Generate Inputs / Outputs Table”.

image

Wait a moment, and you will see a table, listing interesting parameter values which cover all the corner cases in your code.

image

...

Tags:

Follow the Discussion

Remove this comment

Remove this thread

close

Comment on the Post

Already have a Channel 9 account? Please sign in