Skip to content

ENH: Improve itk::ResampleImageFilter class coverage.#461

Merged
jhlegarreta merged 1 commit intoInsightSoftwareConsortium:masterfrom
jhlegarreta:ImproveResampleImageFilterCoverage
Feb 1, 2019
Merged

ENH: Improve itk::ResampleImageFilter class coverage.#461
jhlegarreta merged 1 commit intoInsightSoftwareConsortium:masterfrom
jhlegarreta:ImproveResampleImageFilterCoverage

Conversation

@jhlegarreta
Copy link
Member

Improve itk::ResampleImageFilter class coverage. Specifically, call and
check the GetExtrapolator() and GetOutputDirection() methods:
http://testing.cdash.org/viewCoverageFile.php?buildid=5730024&fileid=32745729

@jhlegarreta
Copy link
Member Author

jhlegarreta commented Feb 1, 2019

CC: @romangrothausmann

And hopefully get another file with 100% code coverage.

Improve `itk::ResampleImageFilter` class coverage. Specifically, call and
check the `GetExtrapolator()` and `GetOutputDirection()` methods:
http://testing.cdash.org/viewCoverageFile.php?buildid=5730024&fileid=32745729

Exercise the rest of the output image region-related Set/Get methods for
the sake of consistency.
@jhlegarreta jhlegarreta force-pushed the ImproveResampleImageFilterCoverage branch from 88f2406 to e6b9294 Compare February 1, 2019 13:20
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jhlegarreta !

@jhlegarreta jhlegarreta merged commit d530e12 into InsightSoftwareConsortium:master Feb 1, 2019
@jhlegarreta jhlegarreta deleted the ImproveResampleImageFilterCoverage branch February 1, 2019 15:29
@romangrothausmann
Copy link
Member

And hopefully get another file with 100% code coverage.

That's great. How is the coverage determined? Is it the number a specific (public) function is exercised with the test suite?
It seems to me that overridden functions are not counted, so this does not check if the filter is tested on its streaming capabilities.

@blowekamp
Copy link
Member

CTest us used to drive a GNU tool call [gcov](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html) There are a few special flags that need to be passed to the compiler to enabling profile. You can find them on the dashboard configuration which does the nightly coverage.

After ITK has been configured you should be able to run the individual ctest steps to start, configure,build,test,converage, and submit the results to the dashboard. I can't seem to find consisce documentation for this right now. Hopefully someone else will chime in.

@jhlegarreta
Copy link
Member Author

jhlegarreta commented Feb 4, 2019

Cannot elaborate much on the documentation side, but for the sake of completeness, the coverage is reported nightly in the corresponding section of the CDash dashboard.

If you inspect the coverage of a file, the number of calls a specific line gets is reported on the left side of each line.

@romangrothausmann can you give a specific example of such a function that is not being reported as covered but is indeed being called?

Just guessing, but if that happens, may be the answer is more on the gcov side, rather than on the CTest side.

@romangrothausmann
Copy link
Member

Thanks for the comments. I'm not very familiar with code coverage tests so far, but the link above made me wonder if the coverage tests actually check if a filter was exercised for streaming, since the streaming implementation is an override.
For example, would the code coverage give info on the fact that the itkWarpImageFilter is exercised on its streaming abilities (which I only know from inspecting itkWarpImageFilterTest2.cxx lately)?

@jhlegarreta
Copy link
Member Author

@romangrothausmann It's been a while since I have had a look at the multi-threading features, and have not checked your streaming enhancements from #392 in detail, and so I would not know to give an accurate answer, so I'll just be generalizing/guessing.

Your PR #392 tests the streaming and non-streaming calls. If the streaming is performed, the base streaming class, if involved, will get an additional coverage count. If the base class is not called/it is an override, the base class count will remain unchanged. I acknowledge that when a method gets tens or hundreds of calls, we really cannot tell where they came from, though. When the count from one nightly report to another increases by one, unless there was a clear commit introducing a new call between them, then it is as hard.

Other than that, if the same code is executed for the streamed and non-streamed cases, and if there are no conditional blocks based on number of stream divisions, the coverage will not let us know about it.

May be @dzenanz or @thewtex could provide a more accurate answer to your question.

@thewtex
Copy link
Member

thewtex commented Feb 4, 2019

@jhlegarreta @romangrothausmann both of your contributions are doing a fine job of improving our coverage! ⛑️

@romangrothausmann
Copy link
Member

Thanks @jhlegarreta for the explanations. I think I understand better now. So, I guess, the answer to my question "Do the coverage reports show somehow that a particular filter was tested with streaming?" is No, because exercising streaming on some filter will only increase the count on the base streaming class and that will not be noted anywhere for the filter that uses it, e.g. we would not know that itkWarpImageFilter is tested for streaming unless going through the code of all its tests "manually".

@jhlegarreta
Copy link
Member Author

@romangrothausmann The involved base streaming class method should get one more count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants