BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Analyze Public .NET Code with Code Digger

| by Anand Narayanaswamy Follow 0 Followers on Apr 28, 2013. Estimated reading time: 1 minute |

Code Digger, an extension for Visual Studio 2012 based on Pex, analyzes possible execution paths through your .NET code. It enables you to understand the behavior of the code by analyzing each row from the displayed table after running the tool from within Visual Studio editor.

The extension recently released by Research in Software Engineering (RiSE) team at Microsoft, not only computes and displays input-output pairs but also locates bugs, exceptions and assertion failures. Moreover, the extension only works on public .NET code that resides in portable class libraries.

Code digger make use of 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.

In order to work with code digger, you have to create a Portable Class Library project using Visual Studio 2012, write public code, right click on the code editor and select Generate Inputs / Outputs Table option. You will now view a table that lists parameter values which cover all the corner cases in your code.

Step 1



Step 2



Output Produced by Code Digger



"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. Our goal is to make the full Pex functionality available for Visual Studio 2012, supporting Fakes instead of Moles, but this combined functionality is not yet ready at this time," said Nikolai Tillmann, Principal Research Software Design Engineer, Microsoft.

The functionality included with code digger can also be explored on the web by visiting Pex4Fun.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT