[vtk-developers] Unit test experience

Will Schroeder will.schroeder at kitware.com
Mon May 9 14:24:40 EDT 2016


Wow Bill you are setting an outstanding example of someone committed to
testing! Thanks, it's efforts like this that add up and make VTK great.
Best,
W

On Mon, May 9, 2016 at 2:19 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:

> Folks,
>
> I occasionally decide to improve coverage of a class or set of related
> classes by writing a unit test. The unit test tries to exercise and
> validate (when possible) all of a class' methods.
>
> Virtually, every time I write a unit test I discover defects. Some are
> trivial, others are significant.
>
> For example, I noticed that vtkGenericGeometryFilter only had about
> 75% coverage. While writing the unit test, I discovered that one of
> the methods ExtentClippingOn() was not working (it never worked!).
>
> The merge request
> https://gitlab.kitware.com/vtk/vtk/merge_requests/1484
> covers 98% of the class.
>
> The class and header have 256 lines of code. The unit test has about
> 300 lines of code. Where possible, the unit test checks the results of
> the methods. If also checks error conditions.
>
> One of these days, I'll write a wiki page describing my approach to
> vtk unit testing.
>
> Bill
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>


-- 
William J. Schroeder, PhD
Kitware, Inc. - Building the World's Technical Computing Software
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160509/6bcfa48d/attachment.html>


More information about the vtk-developers mailing list