On 11/26/2017 08:39 AM, bartc wrote: > The problem was traced to two lines that were in the wrong order (in the > original program). I can't see how unit tests can have helped in any way > at all, and it would probably have taken much longer.
What makes you think that? Surely other decoders were doing the right thing and you could compare your output against theirs? JPEGs may be lossy but the path through the decoder should be deterministic. Or even if every decoder is slightly unique, at least yours should output self-consistent data. In other words, once you know you fixed the chroma problem, you can use that jpeg as a unit test to make sure future big fixes and enhancements don't break something else. Regression testing is very important. Many times I've fixed a bug, only to introduce new ones that broke formerly correct behavior. Anyway, unit testing is certainly a challenging concept, and I'm no more good at it than you are. -- https://mail.python.org/mailman/listinfo/python-list