<div class="gmail_quote">+1 </div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Oct 3, 2012 at 10:41 AM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Oct 3, 2012 at 8:35 AM, Nikhil Shetty &lt;<a href="mailto:nikhil.shetty@kitware.com">nikhil.shetty@kitware.com</a>&gt; wrote:<br>


&gt; Hi Bill,<br>
&gt;<br>
&gt; Are you planning to bring in some type of Unit Testing into VTK?<br>
&gt;<br>
&gt; Currently each tests in VTK tests a bunch of different classes spread across<br>
&gt; different modules. An obvious disadvantage is that some parts of the code<br>
&gt; keeps getting tested multiple times which is sort of pointless (in terms of<br>
&gt; testing). With unit testing one could just focus on one class at at time.<br>
&gt;<br>
<br>
</div>+1 for unit tests...<br>
<br>
BUT:<br>
testing multiple times is not pointless -- there are limitless<br>
possibilities of &quot;combinations of stuff&quot; -- and only with certain<br>
combinations will you find some problem cases.<br>
<br>
Testing as much as you have resources for (but no more) is ALWAYS a good idea.<br>
<br>
Both are useful.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div> </div><div>Definitely Agree.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb">

<div class="h5">
<br>
&gt; Also a unit testing approach may be good for focused coverage where one is<br>
&gt; focused on improving coverage on a limited set of classes.<br>
&gt;<br>
&gt; There are many unit test frameworks out there. CppUnit seem to a good one.<br>
&gt;<br>
&gt; -Nikihl<br>
&gt;<br>
&gt; On Tue, Sep 18, 2012 at 5:43 PM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; My main concern is that vtk coverage is very low, and unacceptable.<br>
&gt;&gt;<br>
&gt;&gt; I would rather spend time on improving the coverage. If others want to<br>
&gt;&gt; improve the process, that is great. Past experience shows that too much time<br>
&gt;&gt; is spent on testing process and too little on actual testing.<br>
&gt;&gt;<br>
&gt;&gt; I say go for it, but I will concentrate in test coverage.<br>
&gt;&gt;<br>
&gt;&gt; Bill<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Sep 18, 2012 at 5:34 PM, David Doria &lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Tue, Sep 18, 2012 at 4:23 PM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt; &gt; Folks,<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; I mentioned earlier that my Fall/Winter VTK project is improving code<br>
&gt;&gt;&gt; &gt; coverage.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; I&#39;m starting with some low hanging fruit, namely Common/Core which has<br>
&gt;&gt;&gt; &gt; 19<br>
&gt;&gt;&gt; &gt; files flagged by cdash as low coverage:<br>
&gt;&gt;&gt; &gt; <a href="http://open.cdash.org/viewCoverage.php?buildid=2568829" target="_blank">http://open.cdash.org/viewCoverage.php?buildid=2568829</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; For example I just pushed this topic to gerrit that addresses testing<br>
&gt;&gt;&gt; &gt; for<br>
&gt;&gt;&gt; &gt; vtkTimePointUtilities, a class that has 0 coverage. I&#39;m pretty sure<br>
&gt;&gt;&gt; &gt; there<br>
&gt;&gt;&gt; &gt; are bugs in this code, mainly surrounding boundary conditions that<br>
&gt;&gt;&gt; &gt; would not<br>
&gt;&gt;&gt; &gt; affect its usage, whatever that may be.<br>
&gt;&gt;&gt; &gt; <a href="http://review.source.kitware.com/#/t/1295/" target="_blank">http://review.source.kitware.com/#/t/1295/</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; But rather than rant, I&#39;ll ask the community to review the gerrit<br>
&gt;&gt;&gt; &gt; topics.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Bill<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; This sounds like a great project.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If you are going to be adding tons of tests, can we discuss a<br>
&gt;&gt;&gt; standardized format for them? The current method of putting everything<br>
&gt;&gt;&gt; in Test[TestName]() seems very error prone (accidental use of<br>
&gt;&gt;&gt; previously defined variables, name clashes, etc) and is definitely<br>
&gt;&gt;&gt; hard to read. I have pushed a new patch set that breaks some things<br>
&gt;&gt;&gt; out into functions. Is there any problem with doing it like this? It<br>
&gt;&gt;&gt; seems much more readable to me. In this case these functions are all<br>
&gt;&gt;&gt; void (because the content doesn&#39;t get checked for failure anyway), but<br>
&gt;&gt;&gt; of course they could return &#39;int&#39; so that &#39;return EXIT_SUCCESS&#39; could<br>
&gt;&gt;&gt; be ANDed with the other tests to produce the final test return value.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thoughts?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; David<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Unpaid intern in BillsBasement at noware dot com<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>