NCoverExplorerFAQ.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <script type="text/javascript">
  5. <!--
  6. function Toggle(id)
  7. {
  8. var e = document.getElementById(id);
  9. if(e.style.display == 'none')
  10. e.style.display = 'block';
  11. else
  12. e.style.display = 'none';
  13. }
  14. function SwitchAll(how)
  15. { var len = document.all.length-1;
  16. for(i=0;i!=len;i++) {
  17. var block = document.all[i];
  18. if (block != null && block.id != '')
  19. { block.style.display=how;}
  20. }
  21. }
  22. function ExpandAll()
  23. {SwitchAll('block');}
  24. function CollapseAll()
  25. {SwitchAll('none');}
  26. // -->
  27. </script>
  28. <title>NCoverExplorer FAQ</title>
  29. <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
  30. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  31. <style>
  32. body { font-size: 10pt; font-family: Verdana; }
  33. p.title { font-size: 20pt; font-weight: bold; }
  34. .action { color: maroon; font-size: 10pt; font-weight: bold; cursor:pointer }
  35. .question { font-weight: bold; cursor:pointer }
  36. .answer { margin: 15px; }
  37. pre { font-size: 10pt; font-family: Courier; }
  38. pre.usage { background-color: #F0F0F0; }
  39. .subtitle { color: maroon; font-weight: bold; }
  40. .quote { background-color: #F0F0F0; margin-left: 36pt;}
  41. .method { color: maroon; font-size: 10pt; font-weight: bold; }
  42. .hdrcell { background-color: #DDEEFF; font-size: 10pt; }
  43. .datacell { background-color: #FFFFEE; text-align: right; font-size: 10pt; }
  44. .hldatacell { background-color: #FFCCCC; text-align: right; font-size: 10pt; }
  45. .box { border: 1px solid; padding: 10px; }
  46. .treeviewBlack { color: black; }
  47. .treeviewGrey { color: grey; }
  48. .treeviewRed { color: red; }
  49. .treeviewBlue { color: blue; }
  50. .sourceBlue { background-color: #E0EDFD; color: black; }
  51. .sourceRed { background-color: #E6B0A5; color: black; }
  52. </style>
  53. </head>
  54. <body>
  55. <P class="title">NCoverExplorer FAQ</P>
  56. <P>The latest version of this document is located <A href="http://www.kiwidude.com/dotnet/NCoverExplorerFAQ.html">here</A>.
  57. <BR/>For the latest NCoverExplorer news and updates, visit my <A href="http://www.kiwidude.com/blog/">blog</A>.</P>
  58. <P class="action"><a onClick="ExpandAll();">Expand All</a>&nbsp;|&nbsp;<a onClick="CollapseAll();">Collapse All</a></P>
  59. <a class="question" onclick="return Toggle('answer1')">1. What is NCoverExplorer?</a><br/>
  60. <div id="answer1" style="display:none">
  61. <P class="answer">This tool allows you to open a coverage.xml file produced by
  62. <A href="http://ncover.org"/>NCover</A> and navigate the source code. The
  63. source code is highlighted to clearly show which statements were visited
  64. and not visited. You can filter, sort and report on the coverage results.
  65. </P>
  66. </div>
  67. <a class="question" onclick="return Toggle('answer2')">2. What versions of the .NET Framework does it work with?</a><br/>
  68. <div id="Div1" style="display:none">
  69. <P class="answer">NCoverExplorer as of version 1.3.4 requires either .NET 1.1 or .Net 2.0 (it is compiled against
  70. .Net 1.1).
  71. </P>
  72. </div>
  73. <a class="question" onclick="return Toggle('answer2')">2. What versions of NCover does it work with?</a><br/>
  74. <div id="answer2" style="display:none">
  75. <P class="answer">NCoverExplorer has been tested with both NCover 1.3.3 and up to the latest NCover 1.5.7. It will NOT
  76. work with NCover 1.4.6. Note that NCover 1.5.x only works with .NET 2.0 and requires at least NCoverExplorer 1.3.5
  77. and/or a TestDriven.Net build > 2.0.1786 due to a limitation in NCover or else you will get duplicate nodes in your
  78. coverage results.
  79. </P>
  80. </div>
  81. <a class="question" onclick="return Toggle('answer3')">3. Can I integrate it with my Visual Studio.Net version XXX IDE?</a><br/>
  82. <div id="answer3" style="display:none">
  83. <P class="answer">Jamie Cansdale now offers a "Test with... Coverage" feature
  84. in the latest version of his excellent <A href="http://www.testdriven.net/">TestDriven.Net</A>
  85. tool. This will automatically launch NCoverExplorer to display the results
  86. of running unit test(s) under code coverage with NCover. Note that as of build 1341
  87. TestDriven.Net now works using both the latest version of NCover (1.5.x) and the earlier NCover 1.3.3 version.
  88. </P>
  89. </div>
  90. <a class="question" onclick="return Toggle('answer4')">4. Can I integrate it without TestDriven.Net?</a><br/>
  91. <div id="answer4" style="display:none">
  92. <P class="answer">My solution I used at work was a combination of NAnt and NAntRunner
  93. (the VS.Net add-in) to perform something similar. I have NAnt tasks to:
  94. <UL>
  95. <LI>
  96. Perform the build.
  97. </LI>
  98. <LI>
  99. Execute NCover while running unit tests (either all unit tests or those for
  100. a specific fixture using the /fixture feature of <A href="http://nunit.org/">NUnit</A>).
  101. </LI>
  102. <LI>
  103. Launch NCoverExplorer displaying the output coverage.xml file.
  104. </LI>
  105. </UL>
  106. </P>
  107. <P class="answer">As of NCoverExplorer 1.3.5 you now have another option. There is now an included GUI for
  108. running NCover directly from within NCoverExplorer and displaying the results.
  109. </P>
  110. </div>
  111. <a class="question" onclick="return Toggle('answer5')">5. How does it compare to Visual Studio Team System?</a><br/>
  112. <div id="answer5" style="display:none">
  113. <P class="answer">VSTS features of unit testing and code coverage will only be included with the premium bundles
  114. of the Visual Studio product range - and as such will most likely be priced above what many
  115. developers and businesses are prepared to pay. For "everyone else" in the market it would seem likely
  116. that they will continue to utilise open source alternatives.
  117. </P>
  118. <P class="answer">Even if you are one of the fortunate developers who can afford VSTS, it still must
  119. be measured feature-wise against the open source alternatives which in a lot of cases have now been established
  120. for many years. Developers and managers will weigh up for themselves how important those features are
  121. as well as other factors such as Microsoft support etc. The nice thing for many of us is that we have a choice...
  122. </P>
  123. <P class="answer">We have had a number of people e-mail us and say they prefer TestDriven.Net and NCoverExplorer
  124. over the VSTS alternative and want to switch off the VSTS ability - that's rather gratifying from our perspective!
  125. </P>
  126. </div>
  127. <a class="question" onclick="return Toggle('answer6')">6. Why didn't you integrate NCoverExplorer directly into the IDE like VSTS or SharpDevelop?</a><br/>
  128. <div id="answer6" style="display:none">
  129. <P class="answer">A number of reasons. At first glance having your code colour coded within the VS.Net IDE may sound
  130. great. However think about what we are trying to achieve - improving our <B>test</B> code to increase our coverage.
  131. That means in many cases you want to be editing the unit tests themselves, not the pretty coloured code under test.
  132. This then requires either a photographic memory or a penchant for continually resizing your IDE/tab groups, as well as an ability
  133. to not find the colours distracting while editing and refactoring code... not my first choice.
  134. </P>
  135. <P class="answer">You may instead find it more convenient to have a separate application window which can be positioned
  136. on a second screen (you all have at least two don't you?) or ALT-Tab switched between. As of release 1.3.1
  137. NCoverExplorer allows direct code navigation from method coverage in NCoverExplorer to it's corresponding line
  138. in the source code file within the VS.Net IDE.
  139. </P>
  140. <P class="answer">From a technical perspective an add-in is a non-trivial task - particularly if trying to support all
  141. the variants of the VS.Net IDE. To do it natively requires VSIP skills which is a trip to the dark side.
  142. I won't say "never" however and if I find some spare time (or you want to volunteer to help me!) then it might
  143. happen one day...
  144. </P>
  145. </div>
  146. <a class="question" onclick="return Toggle('answer7')">7. What do the tree node colours mean?</a><br/>
  147. <div id="answer7" style="display:none">
  148. <P class="answer">The default settings when NCoverExplorer is installed are as follows:
  149. <UL>
  150. <LI>
  151. <SPAN class="treeviewGrey">Grey text</SPAN> - the namespace/class/method has zero coverage. (Icon will be greyed also)
  152. </LI>
  153. <LI>
  154. <SPAN class="treeviewRed">Red text</SPAN> - the namespace/class/method has partial coverage.
  155. </LI>
  156. <LI>
  157. <SPAN class="treeviewBlue">Blue text</SPAN> - the namespace/class/method coverage has partial coverage exceeding a satisfaction threshold (default 95%).
  158. </LI>
  159. <LI>
  160. <SPAN class="treeviewBlack">Black text</SPAN> - the namespace/class/method has 100% coverage.
  161. </LI>
  162. </UL>
  163. </P>
  164. </div>
  165. <a class="question" onclick="return Toggle('answer8')">8. What do the source code highlighting colours mean?<a><br/>
  166. <div id="answer8" style="display:none">
  167. <P class="answer">The default settings when NCoverExplorer is installed are as follows:
  168. <UL>
  169. <LI>
  170. <SPAN class="sourceBlue">Blue background</SPAN> - this section of code was visited (a tooltip tells you how many times).
  171. </LI>
  172. <LI>
  173. <SPAN class="sourceRed">Red background</SPAN> - this section of code was not visited.
  174. </LI>
  175. </UL>
  176. You can change these settings in the View->Options dialog. For instance you may prefer to underline the unvisited code.
  177. </P>
  178. </div>
  179. <a class="question" onclick="return Toggle('answer9')">9. What is that "Satisfaction Threshold" all about?</a><br/>
  180. <div id="answer9" style="display:none">
  181. <P class="answer">Depending on your coverage strategy, the code being tested and the extent of your usage of reflection,
  182. mock objects and/or dependency injection you may determine it unfeasible to try
  183. to reach 100% coverage everywhere. Some teams readily accept the diminishing returns
  184. that can apply and instead set a specific blanket coverage goal such as “85%”.
  185. </P>
  186. <P class="answer">Assuming you have such a situation and there was no threshold capability,
  187. you would be stuck forever looking at a "danger red" node in the tree every time you open NCoverExplorer.
  188. With this feature enabled (by setting a threshold less than 100% in the View->Options dialog) you see
  189. a more calming mellow “blue” instead...
  190. </P>
  191. <P class="answer">As of release 1.3.1 you can now also specify the tolerance as a number of unvisited lines.
  192. If either of the two threshold conditions are met the node will be coloured appropriately. Note that
  193. a visit count of zero will always show as uncovered regardless of your tolerance.
  194. </P>
  195. <P class="answer">Of course just because you exceed the percentage doesn't mean that the 5% of code unvisited
  196. isn't the most critical!
  197. </P>
  198. </div>
  199. <a class="question" onclick="return Toggle('answer10')">10. I have a killer idea for XYZ feature - can you add it for me?</a><br/>
  200. <div id="answer10" style="display:none">
  201. <P class="answer">Please leave a comment on my <A href="http://www.kiwidude.com/blog/">blog</A> or in the
  202. <A href="http://ncover.org/SITE/forums/default.aspx">NCoverExplorer forums</A> and I will see what I can do.
  203. NCoverExplorer is by no means my "day job" so no promises can be made but if the idea is indeed a good one which
  204. will benefit many others I'm sure I can find time...
  205. </P>
  206. </div>
  207. <a class="question" onclick="return Toggle('answer11')">11. Where can I download the latest version?</a><br/>
  208. <div id="answer11" style="display:none">
  209. <P class="answer">To download NCoverExplorer <b>without</b> TestDriven.Net, you can find it
  210. <A href="http://www.kiwidude.com/dotnet/DownloadPage.html">here</A>.
  211. </P>
  212. <P class="answer">Download it as part of the install with TestDriven.Net from <A href="http://www.testdriven.net/">here</A>.
  213. </P>
  214. </div>
  215. <a class="question" onclick="return Toggle('answer12')">12. What are the keyboard shortcuts?</a><br/>
  216. <div id="answer12" style="display:none">
  217. <P class="answer">The following shortcuts exist currently:
  218. <PRE class="usage">
  219. <SPAN class="treeviewBlue">CTRL+A</SPAN> - Collapse all nodes recursively.
  220. <SPAN class="treeviewBlue">CTRL+E</SPAN> - Edit in VS.Net at the current caret position.
  221. <SPAN class="treeviewBlue">CTRL+F</SPAN> - Display the Find Class dialog.
  222. <SPAN class="treeviewBlue">CTRL+L</SPAN> - Expand all nodes recursively.
  223. <SPAN class="treeviewBlue">CTRL+N</SPAN> - Run NCover (via configuration dialog).
  224. <SPAN class="treeviewBlue">CTRL+O</SPAN> - Open coverage xml file.
  225. <SPAN class="treeviewBlue">CTRL+P</SPAN> - Print current source code class file.
  226. <SPAN class="treeviewBlue">CTRL+Q</SPAN> - Expand all covered child nodes.
  227. <SPAN class="treeviewBlue">CTRL+S</SPAN> - Save coverage xml file as displayed (without excluded nodes).
  228. <SPAN class="treeviewBlue">F2</SPAN> - Display the options dialog.
  229. <SPAN class="treeviewBlue">F4</SPAN> - Display the statistics summary dialog.
  230. <SPAN class="treeviewBlue">F5</SPAN> - Reload the current source code file.
  231. <SPAN class="treeviewBlue">F6</SPAN> - Display the reports dialog.
  232. <SPAN class="treeviewBlue">DEL</SPAN> - Exclude node and children from coverage tree and recalculate coverage.
  233. <SPAN class="treeviewBlue">INS</SPAN> - Include node and children into coverage tree and recalculate coverage.
  234. <BR/>
  235. <SPAN class="treeviewBlue">ALT+1</SPAN> - Filter (hide) all 100% coverage nodes.
  236. <SPAN class="treeviewBlue">ALT+2</SPAN> - Filter (hide) all unvisited (0%) nodes.
  237. <SPAN class="treeviewBlue">ALT+3</SPAN> - Filter (hide) all nodes exceeding satisfactory coverage threshold.
  238. <SPAN class="treeviewBlue">ALT+0</SPAN> - Remove all filters.
  239. <BR/>
  240. <SPAN class="treeviewBlue">CTRL+1</SPAN> - Display sequence point coverage report (covered%).
  241. <SPAN class="treeviewBlue">CTRL+2</SPAN> - Display sequence point coverage report (covered%) (unvisited seqpnt#).
  242. <SPAN class="treeviewBlue">CTRL+3</SPAN> - Display sequence point coverage report (unvisited seqpnt#).
  243. <SPAN class="treeviewBlue">CTRL+4</SPAN> - Display function coverage report (visits).
  244. <SPAN class="treeviewBlue">CTRL+5</SPAN> - Display function coverage coverage report (covered%).
  245. <SPAN class="treeviewBlue">CTRL+6</SPAN> - Display function coverage coverage report (covered%) (unvisited function#).
  246. <SPAN class="treeviewBlue">CTRL+7</SPAN> - Display function coverage coverage report (unvisited function#).
  247. <BR/>
  248. <SPAN class="treeviewBlue">CTRL+SHIFT+1</SPAN> - Sort by name (default).
  249. <SPAN class="treeviewBlue">CTRL+SHIFT+2</SPAN> - Sort by name down to class level, with methods sorted by line number.
  250. <SPAN class="treeviewBlue">CTRL+SHIFT+3</SPAN> - Sort by coverage percentage ascending.
  251. <SPAN class="treeviewBlue">CTRL+SHIFT+4</SPAN> - Sort by coverage percentage ascending.
  252. <SPAN class="treeviewBlue">CTRL+SHIFT+5</SPAN> - Sort by #unvisited sequence points ascending.
  253. <SPAN class="treeviewBlue">CTRL+SHIFT+6</SPAN> - Sort by #unvisited sequence points ascending.
  254. <SPAN class="treeviewBlue">CTRL+SHIFT+7</SPAN> - Sort by max function visit count ascending.
  255. <SPAN class="treeviewBlue">CTRL+SHIFT+8</SPAN> - Sort by max function visit count ascending.
  256. <SPAN class="treeviewBlue">CTRL+SHIFT+9</SPAN> - Sort by max function coverage percentage ascending.
  257. <SPAN class="treeviewBlue">CTRL+SHIFT+0</SPAN> - Sort by max function coverage percentage descending.
  258. <BR/>
  259. <SPAN class="treeviewBlue">ALT+RIGHT</SPAN> - Next unvisited line in the current class.
  260. <SPAN class="treeviewBlue">ALT+LEFT</SPAN> - Previous unvisited line in the current class.
  261. <SPAN class="treeviewBlue">ALT+UP</SPAN> - Next unvisited class in the current namespace.
  262. <SPAN class="treeviewBlue">ALT+DOWN</SPAN> - Previous unvisited class in the current namespace.
  263. </PRE>
  264. </P>
  265. </div>
  266. <a class="question" onclick="return Toggle('answer13')">13. Where are my personal settings stored?</a><br/>
  267. <div id="answer13" style="display:none">
  268. <P class="answer">C:\Documents and Settings\[User Name]\Application Data\KiwiNova\NCoverExplorer\NCoverExplorer.config
  269. </P>
  270. </div>
  271. <a class="question" onclick="return Toggle('answer14')">14. Where can I download the custom NAnt/MSBuild tasks from?</a><br/>
  272. <div id="answer14" style="display:none">
  273. <P class="answer">A zip file containing the task source code, compiled assemblies and examples can be found
  274. <A href="http://www.kiwidude.com/dotnet/DownloadPage.html">here</A>
  275. </P>
  276. </div>
  277. <a class="question" onclick="return Toggle('answer15')">15. I get an "Illegal characters in path" exception - why?</a><br/>
  278. <div id="answer15" style="display:none">
  279. <P class="answer">NCover 1.4.6 has a bug whereby the filenames that it writes into the xml file contain
  280. undesirable characters. Please use either NCover 1.3.3 or NCover 1.5.x. For more details refer to this blog entry
  281. <A href="http://www.kiwidude.com/blog/2006/04/illegal-characters-ncover-versions.html">here</A>
  282. </P>
  283. </div>
  284. <a class="question" onclick="return Toggle('answer16')">16. I get a "System.Format" exception - why?</a><br/>
  285. <div id="answer16" style="display:none">
  286. <P class="answer">One user reported a bizarre issue where on their machines a simple int.Parse("0") would not work.
  287. The exact cause is unknown (they had uninstalled some components from their XP installation), however
  288. switching region settings to something else and back again resolved the issue.
  289. </P>
  290. </div>
  291. <a class="question" onclick="return Toggle('answer17')">17. My module thresholds are not working - why?</a><br/>
  292. <div id="answer17" style="display:none">
  293. <P class="answer">The module names included in the module thresholds should not include any path information,
  294. and are currently case sensitive (must exactly match the module names you see on the NCoverExplorer report).
  295. The case sensitivity constraint is fixed in NCoverExplorer 1.3.5.
  296. </P>
  297. </div>
  298. <P class="subtitle">---------------------------------<BR/>FAQ last updated Jul 21st 2007.</P>
  299. </body>
  300. </html>