[vtk-developers] VTK Code Coverage

Bill Lorensen bill.lorensen at gmail.com
Wed Oct 3 15:18:27 EDT 2012


I currently unit test using VTK's testing capabilities. Been doing if for
many years.

People can certainly try something like GTest.


On Wed, Oct 3, 2012 at 12:10 PM, Aashish Chaudhary <
aashish.chaudhary at kitware.com> wrote:

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


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20121003/b9253fa6/attachment.html>


More information about the vtk-developers mailing list