I’m writing some tests for file upload code. The files are binary,
images mostly. I’m futzing around a bit, trying to figure out how to
assert that the uploaded file is the same as some golden master. If I do
this:
Then when it fails, I get an ugly diff of the difference between the
binary files. So I’m about to invent something of my own. Has anyone got
a good pattern for doing this already?
I’m writing some tests for file upload code. The files are binary, images
mostly. I’m futzing around a bit, trying to figure out how to assert that the
uploaded file is the same as some golden master. If I do this:
Then when it fails, I get an ugly diff of the difference between the binary
files. So I’m about to invent something of my own. Has anyone got a good pattern
for doing this already?
In the past I’ve generated a checksum for each file and compared that.
I’m writing some tests for file upload code. The files are binary, images
mostly. I’m futzing around a bit, trying to figure out how to assert that the
uploaded file is the same as some golden master. If I do this:
Then when it fails, I get an ugly diff of the difference between the binary
files. So I’m about to invent something of my own. Has anyone got a good pattern
for doing this already?
In the past I’ve generated a checksum for each file and compare that.
I’m writing some tests for file upload code. The files are binary, images
mostly. I’m futzing around a bit, trying to figure out how to assert that the
uploaded file is the same as some golden master. If I do this:
Then when it fails, I get an ugly diff of the difference between the binary
files. So I’m about to invent something of my own. Has anyone got a good pattern
for doing this already?
In the past I’ve generated a checksum for each file and compare that.
Then when it fails, I get an ugly diff of the difference between the
binary files. So I’m about to invent something of my own. Has anyone
got a good pattern for doing this already?
I don’t already have it, but I’ve long wanted to implement a visual
image diff based on an exclusive-or of the two images. This would give
a quick visual demonstration of the differences.
I once saw (but now cannot find) and image compare library that did a
“fuzzy compare” that wasn’t fooled by pixel differences. I’ve looked
for this several times, but haven’t been able to turn it up again. It’s
out there, though, in the scientific community (IIRC) rather than the
software testing community.
I’m writing some tests for file upload code. The files are binary, images
mostly. I’m futzing around a bit, trying to figure out how to assert that the
uploaded file is the same as some golden master. If I do this:
Then when it fails, I get an ugly diff of the difference between the binary
files. So I’m about to invent something of my own. Has anyone got a good pattern
for doing this already?
cheers,
Matt
I would compare the file’s MD5 (or other) hash. It won’t tell you what
is different… just that they aren’t identical which is what I think you
want. So… something like:
On Fri, Dec 10, 2010 at 4:30 PM, George Dinwiddie [email protected] wrote:
I once saw (but now cannot find) and image compare library that did a “fuzzy
compare” that wasn’t fooled by pixel differences. I’ve looked for this
several times, but haven’t been able to turn it up again. It’s out there,
though, in the scientific community (IIRC) rather than the software testing
community.
I think some teams at the BBC have used this tool for that kind of
fuzzy image comparison: http://pdiff.sourceforge.net/
On Fri, Dec 10, 2010 at 4:30 PM, George Dinwiddie [email protected] wrote:
I once saw (but now cannot find) and image compare library that did a “fuzzy
compare” that wasn’t fooled by pixel differences. I’ve looked for this
several times, but haven’t been able to turn it up again. It’s out there,
though, in the scientific community (IIRC) rather than the software testing
community.
I think some teams at the BBC have used this tool for that kind of
fuzzy image comparison: http://pdiff.sourceforge.net/
I would compare the file’s MD5 (or other) hash. It won’t tell you what is
different… just that they aren’t identical which is what I think you want.
So… something like: