|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
OK, does anybody *else* find that testing software makes you...
slightly... paranoid??
I wrote a program with the simple purpose of checking that two files are
identical. It passed all the tests I constructed. Performed flawlessly.
(But then, it's a pretty trivial task, right?)
Today, I suddenly discovered that it sometimes gives you the wrong
answer. (!!!) Specifically, I constructed two very slightly different
files that are erroneously reported as being identical.
Obviously, it's pretty easy to fix my program, and I can add a new test
case to the system to catch this in future. But considering that "it's
so simple there's nothing that can go wrong"... now I'm wondering
exactly what the hell *else* my test cases haven't caught! o_O
[For anybody who cares: I forgot to put the streams into binary mode. So
all the line-ends get converted to canonical form. OOPS!!]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I wrote a program with the simple purpose of checking that two files are
> identical. It passed all the tests I constructed. Performed flawlessly.
> (But then, it's a pretty trivial task, right?)
>
> Today, I suddenly discovered that it sometimes gives you the wrong
> answer. (!!!)
Good job you weren't using it for something mission critical :-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> Today, I suddenly discovered that it sometimes gives you the wrong
>> answer. (!!!)
>
> Good job you weren't using it for something mission critical :-)
._.
Erm... yes.
[I mean, realistically, what are the chances of two binary files being
identical except for an extra few 0x0A bytes, all of which just happen
to be prefixed by 0x0D bytes? Pretty small. But even so... EEEEK!!]
I think the worrying this is not so much that I wrote a bad program, but
that I came up with ineffective test data. :-/
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
What...the...hell...?
I just had a closer look at my test data. For reasons *beyond* my powers
of comprehension, I used a hand-written LCG psuedorandom number
generator to generate the file contents. Trouble is, the particular
coefficients I picked have a period of... four.
*WHY* would I do such a thing?! >_<
Of course, The *Real* WTF is that I seeded my broken PRNG using... the
system PRNG. Which actually works correctly.
Dude. Seriously. What the HELL was I smoking that day?? [shakes head in
disbelief] I literally cannot *believe* I managed to do something this
retarded...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
48342848$1@news.povray.org...
>> I wrote a program with the simple purpose of checking that two files are
>> identical. It passed all the tests I constructed. Performed flawlessly.
>> (But then, it's a pretty trivial task, right?)
>>
>> Today, I suddenly discovered that it sometimes gives you the wrong
>> answer. (!!!)
>
> Good job you weren't using it for something mission critical :-)
Remember that Invisible works for a company that specialises in
bioanalytical chemistry. This can be quite critical. If you send them your
kid's DNA for paternity testing, don't be surprised if their answer is that
1) that you're not the father and 2) according to their files the read dad
is a French poodle named Fluffy.
G.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Gilles Tran wrote:
> Remember that Invisible works for a company that specialises in
> bioanalytical chemistry. This can be quite critical. If you send them your
> kid's DNA for paternity testing, don't be surprised if their answer is that
> 1) that you're not the father and 2) according to their files the real dad
> is a French poodle named Fluffy.
1. If you send *us* some DNA for testing, that's roughly the answer
you'd get. We don't even have the equipment to perform that kind of
work. ;-)
2. How the hell would you know the poodle is named Fluffy just from it's
DNA? :-P
3. It's a good thing that when we finally put this stuff into operation,
it's only going to be used for checking our backup CDs anyway...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> I just had a closer look at my test data. For reasons *beyond* my powers
> of comprehension, I used a hand-written LCG psuedorandom number
> generator to generate the file contents. Trouble is, the particular
> coefficients I picked have a period of... four.
>
> *WHY* would I do such a thing?! >_<
Somebody on the Haskell list just wrote
"Did you also by any chance patch Debian's OpenSSL a few years back?"
I think I just got 0WN3D. :-(
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
>
> I wrote a program with the simple purpose of checking that two files are
> identical. It passed all the tests I constructed. Performed flawlessly.
> (But then, it's a pretty trivial task, right?)
>
No offence, but why do you need to reinvent the wheel? Just use diff.
For future cases there's lots of useful small programs ported on
Windows, too ;).
http://unxutils.sourceforge.net/
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethiszbxtnetinvalid
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> [I mean, realistically, what are the chances of two binary files being
> identical except for an extra few 0x0A bytes, all of which just happen
> to be prefixed by 0x0D bytes? Pretty small. But even so... EEEEK!!]
Unless you loaded it into an editor that converts line endings for you?
Or downloaded it via FTP in the wrong mode?
Lots of ways *that* can get screwed up.
And yes, I had the same problem I ran across in one of my programs. I
have no idea how it passed the tests in the previous version of Tcl I
was using and failed them now. It should have failed all along. (Create
a bunch of files. Delete some. Scan the results. You'd think the "are
the two different" would have failed when passed the "original" list
twice, yes? :-)
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> What...the...hell...?
>
> I just had a closer look at my test data. For reasons *beyond* my powers
> of comprehension, I used a hand-written LCG psuedorandom number
> generator to generate the file contents. Trouble is, the particular
> coefficients I picked have a period of... four.
>
> *WHY* would I do such a thing?! >_<
>
> Of course, The *Real* WTF is that I seeded my broken PRNG using... the
> system PRNG. Which actually works correctly.
>
> Dude. Seriously. What the HELL was I smoking that day?? [shakes head in
> disbelief] I literally cannot *believe* I managed to do something this
> retarded...
>
It's one of those "who the hell wrote this piece of... oh" moments
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |