msimet / Stile

Stile: the Systematics Tests In Lensing pipeline
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

Unit tests for graphical SysTests #55

Open msimet opened 9 years ago

msimet commented 9 years ago

Hi folks,

I just realized that we don't have any unit tests for the ScatterPlot or WhiskerPlot sys tests. We clearly should have some, but the question is, since the main outputs are graphics...how do we test them?

We discussed this a bit back in the early planning stages of Stile, and I think the best idea I heard was to have a 'canonical' image stored in the repository, and then generate a 'test' image that reproduces that saved image in one half and plots the to-be-tested graphic in the other half. Users would then have to look at the generated images and verify that they were qualitatively the same. I can look into code that does this, unless somebody has another suggestion? (Another idea might be to dig into exactly what data is stored by matplotlib and how, but that may be nitty gritty stuff that wouldn't be too enlightening--hard to know unless we try.)

There are probably also numeric routines in those specific SysTests that should be unit tested as well, but I admit I haven't looked too closely for what they should be.