ENH: Improve coverage for itk::FastMarchingImageFilterBase.#114
Conversation
|
@jhlegarreta This was almost 2 years old. I hope I rebased properly. |
|
Jon Hait... Gorroño Jon Haitz Legarreta Gorroño (3 comments) Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx Looks like expected value is about/almost zero: Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx Kitware Build Robot Build Failed: CDash filtered results: https://open.cdash.org/index.php?&project=Insight&filtercount=3&field1=buildname/string&compare1=63&value1=22311-1&field2=buildstarttime/date&compare2=83&value2=2015-03-01&field3=buildstarttime/date&compare3=84&value3=2029-01-01 Jon Haitz Legarreta Gorroño On the other hand, I'm well aware that setting the output image properties in itkFastMarchingImageFilterBase.cxx is not really meaningful since no real computation/check is performed. Setting them in *RealTest1.cxx or *RealTest2.cxx seemed not be very cautious to me given that my understanding of such implications is limited/was confused about the funny way (the "1.42") the output values were being checked. Otherwise, we could write the output image in itkFastMarchingImageFilterBase.cxx and check the MD5 hash, using and w/o using the output image properties (i.e. two tests). That may require some a deeper understanding concerning the trial points, etc. which I may not have. An alternative would be setting such properties in *RealTest1.cxx or *RealTest2.cxx, and checking that the test still passes. If it passes, it would be a little bit hard to understand why such a change does not affect the result/may indicate a bug (?); if not, I ignore how hard it'd be adapting it to check the right values. Matt McCormick (3 comments) Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx Line 63: Line 72: |
|
Accidently deleted/closed branch when the script for moving from Gerrit went haywire. |
5763a17 to
e6c7d94
Compare
e6c7d94 to
2b5b291
Compare
2b5b291 to
d8fd156
Compare
|
@thewtex @jhlegarreta This issue is almost 2 years old. I spent some time today making this PR pass regression tests. While I am certain that more work could be done, I would like to move this incremental better solution forward to remove it from the 2-year-old backlog. I don't think there is much interest in pursuing this more aggressively at the moment. |
|
@hjmjohnson thanks for caring about this. I'll have a look at the comments/what was left undone it during the next few days, do the appropriate changes if any, and give some feedback. |
Exercise basic object methods.
Test all Set/Get methods using the TEST_SET_GET_VALUE macro, and all
On/Off methods corresponding to boolean members usign the
TEST_SET_GET_BOOLEAN macro.
Use the TRY_EXPECT_NO_EXCEPTION macro to update the filter and save
tryping the try/catch blocks.
Prefer initialization over assignment in variables.
Use the itkNotUsed macro for test input arguments and hence avoid
casting argc and argv to void to avoid compiler warnings.
Remove printing the input (speed) image.
Remove the calls to the Get* methods corresponding to base class
members (specifically: m_SpeedConstant, m_TargetReachedValue, and
m_NormalizationFactor should be tested for itk::FastMarchingBase in
itkFastMarchingBaseTest.cxx; and m_StoppingValue and GetCollectPoints
should be tested for itk::FastMarchingImageFilter in
itkFastMarchingTest.cxx).
Start comments with capital letters.
Minor style changes (such as white spaces between operators and
arguments, improvement of type names and error messages).
-- COMP: Fix missing typename in templated functions
ITK/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx:40:3:
ITK/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx:45:3:
ITK/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx:50:3:
ITK/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx:55:3:
ITK/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx:60:3:
error: missing 'typename' prior to dependent type name 'FastMarchingImageFilterType::OutputSizeType'
FastMarchingImageFilterType::OutputSizeType outputSize;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- BUG: Fix incorrect superclass naming
Missing itkTypeMacro, and incorrect superclass designations
found with EXERCISE_BASIC_OBJECT_METHODS.
-- STYLE: Create unique local function name
Create a test function name that is distinctly different
from the name of the class being tested.
Document explicitly the intent of the testing function.
This testing function is not instrumented to actually
test the filter (too few inputs provided), but rather
tests the basic getters/setters for the base class.
The actuall testing of the algorithms is performed
in other tests.
Co-authored by: Jon Haitz Legarreta Gorroño <jon.haitz.legarreta@gmail.com>
d8fd156 to
e025dd5
Compare
|
Rebased on master for now. Revision to come later next week. |
|
@jhlegarreta Can this be pushed as is, and then your additions added once you find the time? I'd hate for this 2-year-old PR to become stale again. |
|
@hjmjohnson @thewtex Thanks for your patience. I went through the comments. It does not look complicated what is left to improve the robustness of the tests, but it requires some time. As Hans told me a few weeks ago, "Don't let perfection be the enemy of the good", so for the time being, I think it is reasonable to merge it as it is, given that checks are passing, and it is already an improvement and a step towards the right direction. I've opened an issue (#599) to keep track of the pending tasks. As said, affordable to anyone in the community, useful for all. Sorry for taking so long to review it. |
|
@thewtex Now we just need someone to approve, and it can be merged! Let's try to get this in before 2 years have passed 👍 . |
thewtex
left a comment
There was a problem hiding this comment.
Thanks for the contribution and persistence!
Exercise basic object methods.
Test all Set/Get methods using the TEST_SET_GET_VALUE macro, and all
On/Off methods corresponding to boolean members usign the
TEST_SET_GET_BOOLEAN macro.
Use the TRY_EXPECT_NO_EXCEPTION macro to update the filter and save
tryping the try/catch blocks.
Prefer initialization over assignment in variables.
Use the itkNotUsed macro for test input arguments and hence avoid
casting argc and argv to void to avoid compiler warnings.
Remove printing the input (speed) image.
Remove the calls to the Get* methods corresponding to base class
members (specifically: m_SpeedConstant, m_TargetReachedValue, and
m_NormalizationFactor should be tested for itk::FastMarchingBase in
itkFastMarchingBaseTest.cxx; and m_StoppingValue and GetCollectPoints
should be tested for itk::FastMarchingImageFilter in
itkFastMarchingTest.cxx).
Start comments with capital letters.
Minor style changes (such as white spaces between operators and
arguments, improvement of type names and error messages).