<div dir="ltr">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.<div>Best,<br>W</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 2:19 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Folks,<br>
<br>
I occasionally decide to improve coverage of a class or set of related<br>
classes by writing a unit test. The unit test tries to exercise and<br>
validate (when possible) all of a class' methods.<br>
<br>
Virtually, every time I write a unit test I discover defects. Some are<br>
trivial, others are significant.<br>
<br>
For example, I noticed that vtkGenericGeometryFilter only had about<br>
75% coverage. While writing the unit test, I discovered that one of<br>
the methods ExtentClippingOn() was not working (it never worked!).<br>
<br>
The merge request<br>
<a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/1484" rel="noreferrer" target="_blank">https://gitlab.kitware.com/vtk/vtk/merge_requests/1484</a><br>
covers 98% of the class.<br>
<br>
The class and header have 256 lines of code. The unit test has about<br>
300 lines of code. Where possible, the unit test checks the results of<br>
the methods. If also checks error conditions.<br>
<br>
One of these days, I'll write a wiki page describing my approach to<br>
vtk unit testing.<br>
<br>
Bill<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>William J. Schroeder, PhD<br>Kitware, Inc. - Building the World's Technical Computing Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div></div></div>
</div>