brain-microstructure-exploration-tools / abcd-microstructure-pipelines

Processing pipelines to extract brain microstructure from ABCD Study dMRI
Apache License 2.0
0 stars 1 forks source link

19 write a unit test for gen masks stuff #25

Closed ebrahimebrahim closed 7 months ago

ebrahimebrahim commented 7 months ago

Close #19

Just want to start the habit of unit testing and set a precedent.

For the b0 mean I separated out the trivial computation from the IO step because that's a good pattern and also because it gives me something to unit test.

Some IO things are hard to separate though. Like HD-BET is going to do its own thing and it ultimately operates on files and not arrays (right? if that's not the case and it's possible to make it operate on arrays then we should do that...)

And I haven't thought of a good way to unit test the actual IO steps. @allemangD any thoughts on that? Now that compute_b0_mean is tested, how would you approach the problem of testing gen_b0_mean? Mocking? Having some small actual data files to run on?

ebrahimebrahim commented 7 months ago

Thoughts about testing based on our discussion this morning:

also for testing things like the hd-bet step I would say we should do mocking

@allemangD does that about cover it? please add any notes/thoughts about testing that I missed. I will add more tests

allemangD commented 7 months ago

Since you created #26 for adding more tests, I'll go ahead and merge this and create a different PR for #26 rather than cluttering this one.