Let’s say that we want to use these code coverage results in a report or simply share them externally. To do that, click on the Export Results button. Figure 46 Exporting code coverage results In the Save Coverage Data as XML window, you could save the code coverage data to an XML file, but for the purposes of this lab, go ahead and simply Cancel out of the dialog and continue on to the next exercise. Figure 47 Saving code coverage results to file In this exercise, you will learn about the new Code Clone analysis feature first introduced in Visual Studio 2012. This tool looks for semantically similar code using a heuristic search technique, rather than simply searching for exact matches. Select Analyze | Analyze Solution for Code Clones from the main menu in Visual Studio. Figure 48 Analyze solution for code clones Once the analysis is complete, the Code Clone Analysis Results window will show clone candidates grouped by match strength. Expand the group to expose the two files Strong Match that had a strong match. Figure 49 Viewing the strong file matches Each line shows the class and method, specific file, and lines that were determined to be strong matches. If you mouse over each match, a snippet of code gives you quick glance at some of the matching code.
Let’s say that we want to use these code coverage results in a report or simply share them externally. To do that, click on the Export Results button. Figure 46 Exporting code coverage results In the Save Coverage Data as XML window, you could save the code coverage data to an XML file, but for the purposes of this lab, go ahead and simply Cancel out of the dialog and continue on to the next exercise. Figure 47 Saving code coverage results to file In this exercise, you will learn about the new Code Clone analysis feature first introduced in Visual Studio 2012. This tool looks for semantically similar code using a heuristic search technique, rather than simply searching for exact matches. Select Analyze | Analyze Solution for Code Clones from the main menu in Visual Studio. Figure 48 Analyze solution for code clones Once the analysis is complete, the Code Clone Analysis Results window will show clone candidates grouped by match strength. Expand the Strong Match group to expose the two files that had a strong match. Figure 49 Viewing the strong file matches Each line shows the class and method, specific file, and lines that were determined to be strong matches. If you mouse over each match, a snippet of code gives you quick glance at some of the matching code.
Unit%20Testing,%20Code%20Coverage%20and%20Code%20Clone%20Analysis%20with%20Visual%20Studio%202013.docx