I currently unit test using VTK's testing capabilities. Been doing if for many years.<br><br>People can certainly try something like GTest.<br><br><br><div class="gmail_quote">On Wed, Oct 3, 2012 at 12:10 PM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If we want to use a unit test library, I would recommend googletest (I<br>
have some testing with it and found it better compare to cppunit). Its<br>
BSD license and I think other folks at Kitware are using gtest<br>
(correct me if I am wrong).<br>
<br>
For some of the comparisons, read here:<br>
<a href="http://stackoverflow.com/questions/7922289/googletest-vs-cppunit-the-facts" target="_blank">http://stackoverflow.com/questions/7922289/googletest-vs-cppunit-the-facts</a><br>
<br>
and here:<br>
<a href="http://stackoverflow.com/questions/242926/comparison-of-c-unit-test-frameworks" target="_blank">http://stackoverflow.com/questions/242926/comparison-of-c-unit-test-frameworks</a><br>
<br>
Best,<br>
<br>
<br>
On Wed, Oct 3, 2012 at 11:31 AM, Nikhil Shetty<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:nikhil.shetty@kitware.com">nikhil.shetty@kitware.com</a>> wrote:<br>
> +1<br>
><br>
> On Wed, Oct 3, 2012 at 10:41 AM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
>><br>
>> On Wed, Oct 3, 2012 at 8:35 AM, Nikhil Shetty <<a href="mailto:nikhil.shetty@kitware.com">nikhil.shetty@kitware.com</a>><br>
>> wrote:<br>
>> > Hi Bill,<br>
>> ><br>
>> > Are you planning to bring in some type of Unit Testing into VTK?<br>
>> ><br>
>> > Currently each tests in VTK tests a bunch of different classes spread<br>
>> > across<br>
>> > different modules. An obvious disadvantage is that some parts of the<br>
>> > code<br>
>> > keeps getting tested multiple times which is sort of pointless (in terms<br>
>> > of<br>
>> > testing). With unit testing one could just focus on one class at at<br>
>> > time.<br>
>> ><br>
>><br>
>> +1 for unit tests...<br>
>><br>
>> BUT:<br>
>> testing multiple times is not pointless -- there are limitless<br>
>> possibilities of "combinations of stuff" -- 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<br>
>> idea.<br>
>><br>
>> Both are useful.<br>
>><br>
><br>
> Definitely Agree.<br>
><br>
>><br>
>><br>
>> > Also a unit testing approach may be good for focused coverage where one<br>
>> > is<br>
>> > focused on improving coverage on a limited set of classes.<br>
>> ><br>
>> > There are many unit test frameworks out there. CppUnit seem to a good<br>
>> > one.<br>
>> ><br>
>> > -Nikihl<br>
>> ><br>
>> > On Tue, Sep 18, 2012 at 5:43 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> My main concern is that vtk coverage is very low, and unacceptable.<br>
>> >><br>
>> >> I would rather spend time on improving the coverage. If others want to<br>
>> >> improve the process, that is great. Past experience shows that too much<br>
>> >> time<br>
>> >> is spent on testing process and too little on actual testing.<br>
>> >><br>
>> >> I say go for it, but I will concentrate in test coverage.<br>
>> >><br>
>> >> Bill<br>
>> >><br>
>> >><br>
>> >> On Tue, Sep 18, 2012 at 5:34 PM, David Doria <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>><br>
>> >> wrote:<br>
>> >>><br>
>> >>> On Tue, Sep 18, 2012 at 4:23 PM, Bill Lorensen<br>
>> >>> <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>> >>> wrote:<br>
>> >>> > Folks,<br>
>> >>> ><br>
>> >>> > I mentioned earlier that my Fall/Winter VTK project is improving<br>
>> >>> > code<br>
>> >>> > coverage.<br>
>> >>> ><br>
>> >>> > I'm starting with some low hanging fruit, namely Common/Core which<br>
>> >>> > has<br>
>> >>> > 19<br>
>> >>> > files flagged by cdash as low coverage:<br>
>> >>> > <a href="http://open.cdash.org/viewCoverage.php?buildid=2568829" target="_blank">http://open.cdash.org/viewCoverage.php?buildid=2568829</a><br>
>> >>> ><br>
>> >>> > For example I just pushed this topic to gerrit that addresses<br>
>> >>> > testing<br>
>> >>> > for<br>
>> >>> > vtkTimePointUtilities, a class that has 0 coverage. I'm pretty sure<br>
>> >>> > there<br>
>> >>> > are bugs in this code, mainly surrounding boundary conditions that<br>
>> >>> > would not<br>
>> >>> > affect its usage, whatever that may be.<br>
>> >>> > <a href="http://review.source.kitware.com/#/t/1295/" target="_blank">http://review.source.kitware.com/#/t/1295/</a><br>
>> >>> ><br>
>> >>> > But rather than rant, I'll ask the community to review the gerrit<br>
>> >>> > topics.<br>
>> >>> ><br>
>> >>> > Bill<br>
>> >>><br>
>> >>> This sounds like a great project.<br>
>> >>><br>
>> >>> If you are going to be adding tons of tests, can we discuss a<br>
>> >>> standardized format for them? The current method of putting everything<br>
>> >>> in Test[TestName]() seems very error prone (accidental use of<br>
>> >>> previously defined variables, name clashes, etc) and is definitely<br>
>> >>> hard to read. I have pushed a new patch set that breaks some things<br>
>> >>> out into functions. Is there any problem with doing it like this? It<br>
>> >>> seems much more readable to me. In this case these functions are all<br>
>> >>> void (because the content doesn't get checked for failure anyway), but<br>
>> >>> of course they could return 'int' so that 'return EXIT_SUCCESS' could<br>
>> >>> be ANDed with the other tests to produce the final test return value.<br>
>> >>><br>
>> >>> Thoughts?<br>
>> >>><br>
>> >>> David<br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Unpaid intern in BillsBasement at noware dot com<br>
>> >><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> >><br>
>> >> Visit other Kitware open-source projects at<br>
>> >> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >><br>
>> >> Follow this link to subscribe/unsubscribe:<br>
>> >> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>> >><br>
>> >><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>> ><br>
>> ><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
| Aashish Chaudhary<br>
| R&D Engineer<br>
| Kitware Inc.<br>
| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>