BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Analyze Public .NET Code with Code Digger

by Anand Narayanaswamy on Apr 28, 2013 |

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.

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

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT