Visual Studio 13 and Code Digger (Pex) Installation Instructions

Visual Studio 13 and Code Digger (Pex) Installation Instructions

Visual Studio 13 and Code Digger (Pex) installation instructions

  1. Visual Studio Install Instructions
  2. These instructions are only for users who have Windows machines. For virtual machine instructions see section 3.
  3. Go to and choose Visual Studio 2013 Community Edition, update 5. In the drop down list, choose EXE instead of DVD. Click on Download.
  4. After the download completes, click on the .exe file to start installation. The wizard will prompt for additional installations, by displaying checkboxes. Uncheck all of them and proceed to install.
  5. Code Digger Download and Install
  6. These instructions are only for users who have Windows machines and have installed VS13.
  7. Go to - and click on download. Click on the downloaded file to install the tool.
  8. Restart Visual Studio.
  9. Virtual Machine for Windows
  10. Install Oracle VirtualBox from by following the install instructions according to your operating system.
  11. Obtain a copy of the Windows virtual machine (extension .ovf) from Snigdha Athaiya.
  12. Run the VirtualBox manager with administrative or super user privilege.
  13. In the manager window, select File Import Appliance. Locate the .ovf file and follow the import wizard without changing any settings.
  14. After the import, the VirtualBox manager will list the machine. Select it and click on the Start button. This will run your machine and start Windows 7 in a separate window.
  15. This virtual machine comes pre-installed with VS13 and Code Digger.
  1. Visual Studio Usage

Run Visual Studio with administrator privilege – right click on Visual Studio menu option Run as Administrator.

  1. Creating a Console Application Project
  • Click on File New Project
  • Select from side pane, Visual C# Windows Desktop Console Application
  • Edit the name of the project and solution. A solution is a mini workspace where we will keep all related projects.
  • Click OK. The project will be created. It will be displayed in the Solution explorer at the right hand side in the IDE. The explorer lists your Solution and the project under it.
  • You can then add classes to the project by – Right Click on Project name in the solution explorer Add Class
  • Unlike Java, the classes in C# need not have the same name as the source file.
  • The Project needs to have at least one class with the static void Main(string[] args) { }.
  • Creating a Test Project for Testing the Console Application Project
  • Click on File New Project
  • Select from Side pane Visual C# Test Unit Test Project.
  • Edit the name of the project, and select “Add to solution” from the drop-down list labelled Solution.
  • Click OK. This will add your test project to the same solution and it will be visible in the solution explorer.
  • Adding Project Reference – Expand the Test Project tree in the Explorer right click on References Add Reference Solution Projects Select your project that you added in Section 4.a.
  • Adding Test Frameworks – Right click on References Manage Nuget Packages Online. In the Search bar, type “MSTest”. Install MSTest.TestFramework and MSTest.TestAdapter.
  • Expand test project References. Right click on Microsoft.VisualStudio.QualityTools.UnitTestFramework Click on Remove.
  • To create a test case – Right Click on test project Add Class Name the class. Add “using <The Project namespace from Section 4.a> ;” and “using Microsoft.VisualStudio.TestTools.UnitTesting;“ at the beginning of the code. The using keyword is similar to the Java import statement.
  • Annotate the class with [TestClass] attribute and each test case method with [TestMethod] attribute.
  • Running the Unit tests
  • After you save the test cases, build the solution by Right Click on Solution Build solution
  • Click on Test Windows Test Explorer.
  • The explorer should list all your tests. The tests can be run by right clicking either the test method in the source code or in the test explorer and selecting “run tests”.
  • In case the explorer does not list the tests, close Visual Studio. Go to the folder {home}/AppData/Temp/VisualStudioTestExplorerExtensions and empty the folder. Restarting the IDE now (in admin mode) will list all the tests. The {home} is the location of your user folder in Windows.
  1. Importing the class solution in Visual Studio
  • Unzip the file PexDemo-class.
  • In Visual Studio, click on File Open Project/Solution. Locate the unzipped folder and the select .sln file inside it. This will import the solution and display it in the solution explorer.
  • Right click on the PexDemo-class solution heading and click on “clean solution”.
  • In the PexDemoTests project- expand the project tree Right click on References Manage Nuget Packages Uninstall and Re-install the MSTest packages (MSTest.TestFramework and MSTest.TestAdapter). Build the project again.
  • The test cases will be identified by the test explorer. In case they are not, follow the instructions as in Section 4.c.
  1. Running Code Digger
  • Before running Code Digger, go to Tools Options Pex Under Code Digger change the value of “DisableCodeDiggerPortableClass” to true. Click OK.
  • Now, right clicking on any method name in the source code and selecting “Generate Input/Output tables” will display the code digger results.