3 ms·
I have problems with this as well. Sometimes there are obvious things that can be tested on the resulting image. For example when applying a blur on a grey imag
by halomru 10y ago
I have problems with this as well. Sometimes there are obvious things that can be tested on the resulting image. For example when applying a blur on a grey image with one white pixel in the middle, I know how I expect the sum of the pixel values to change, and I know the upper and lower bounds of valid pixel values.
After the fact unit tests that verify that abs(expectedImage - resultingImage) < e are also helpful. But unless you write some modeling application that has to produce exact results, a lot of code is typically about what looks good, not about what's mathematically correct. Those parts are probably impossible to properly test automatically.