--- On Thu, 17/2/11, David Golden <xda...@gmail.com> wrote:

> From: David Golden <xda...@gmail.com>

> wrote:
> > It's OK if I get back that data structure, but the 2
> and 4 records are swapped or maybe the 5 isn't present.
> However, for any contained array reference its exact data
> can't change. However, if those came back in the order of
> 6,5,4,3,2,1, the test should fail (thus, I can't use bag
> tests).
> 
> Do you have actual hard criteria?  Or is it
> fuzzy/arbitrary?  How do
> you know that one swap is OK, but a full reversal is not?
> 
> Put differently, with the criteria you describe, I have a
> hard time
> seeing how this could actually be a meaningful test. 
> Can you explain
> more about the problem domain?

I don't think I can describe the exact problem domain without violating my 
employment agreement. Let's just say there's a "threshold" in the code which 
allows one to determine the amount of fuzziness allowed.

For a *very* contrived use case, imagine that you're being introduced to your 
daughter's boyfriend for the first time and you know his name is "Alexander". 
He might introduce himself as "Alexander", "Alex", "Al", or even "Xander" and 
you might not bat an eyelash. If he introduces himself as "Sally" or "Bob", 
it's times to start asking questions.

In my case, I have code which returns a list of items, but I'm pulling real 
data (and it's very hard not to pull real data for this use case) and that data 
will *usually* be in the order I expect, but subtle variations are allowed and 
cannot be easily prevented. Unfortunately, I can't tell you more than this.

Cheers,
Ovid
--
Live and work overseas - http://overseas-exile.blogspot.com/
Buy the book           - http://www.oreilly.com/catalog/perlhks/
Tech blog              - http://blogs.perl.org/users/ovid/
Twitter                - http://twitter.com/OvidPerl/

Reply via email to