[Insight-developers] coverage

Lorensen, William E (Research) lorensen at crd . ge . com
Wed, 21 May 2003 11:31:22 -0400


Did you look at the coverage report for those files on the dashboard?
For example:
http://public.kitware.com/Insight/Testing/HTML/TestingResults/Sites/esopus.c
rd/SunOS-5.7-c++/Coverage/__Code_BasicFilters_itkGaussianImageSource_h.html
shows that many of the Get macros are not exercised.
The number at the left is the number of times a statement was executed. The
##### indicate code that is not covered.  A blank means the code was never
compiled or is not an executable statement.

To improve, if there is already a test, you can add code to test those lines
that are not covered. Often error conditions are not tested and it may be
hard to do so.

Our goal is at least 70% coverage. The example above can easily reach that
adding Get's to the test.

Also, the corresponding .txx is very well covered. 

Your second example shows that the BloxCoreAtomItem is never used. At least
the constrcutor/destrcutor is never executed. And the method
CalcCenterAndDiameter is not even compiled.


In summary, the coverage is per file, not per object.


-----Original Message-----
From: Damion Shelton [mailto:beowulf@cs.cmu.edu]
Sent: Wednesday, May 21, 2003 11:03 AM
To: William E Lorensen
Cc: Insight-developers@public.kitware.com
Subject: [Insight-developers] coverage


A few questions...

There are lots of cases with my files where the coverage reports are:

BasicFilters/itkGaussianImageSource.h   46.15
BasicFilters/itkGaussianImageSource.txx 90.16

It's not clear to me why the coverage amounts differ for a given class. 
It looks like the coverage is good for the .txx but not the .h, despite 
being the same class. In other cases it's even more extreme:

Common/itkBloxBoundaryPointPixel.h      0.00
Common/itkBloxBoundaryPointPixel.txx    100.00

How is coverage "improved"? If there is "not enough", what is "more"? 
Do the tests need to do more, or does the object need to be created in 
a greater number of tests?

What about completely virtual base classes? e.g.

Common/itkBloxCoreAtomItem.h    0.00
Common/itkBloxCoreAtomItem.txx  0.00

Thanks,
-Damion-

---------
Damion Shelton
Carnegie Mellon University, Robotics Institute
A408-o Newell Simon Hall
412.268.3866 (office)
412.818.8829 (cell)
http://www.cs.cmu.edu/~beowulf
---------
During the Middle Ages, probably one of the biggest mistakes was not 
putting on your armor because you were "just going down to the corner."

_______________________________________________
Insight-developers mailing list
Insight-developers@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers