This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Testing and the fly likes Test Suggestions ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Test Suggestions ..." Watch "Test Suggestions ..." New topic
Author

Test Suggestions ...

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'm looking to see if anybody can bump me past a writer's block. I have this algorithm I've used for 25 years to handle two lists in sorted order ...

Now I want to extend it to handle any number of lists. I think it's going to be

I'm not dead sure this is right, and I'm stumped on tests. Waddya think?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Mhh, what if you solved that problem a slightly different way?

For example, what if you had a CompositeList that, well, is a composite of two lists and uses your algorithm? By having composites of composites of composites etc. you might be able to handle an arbitrary amount of lists without complicating the algorithm...

Just a raw, wild idea, frankly.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Where I am right now is resisting putting the handleFound and handleMissing methods in an interface so I can stub them out. I think I'll just bite the bullet and try it.

This is running a query against the same table on 8-10 databases - dev, qa, prod, etc. I think the output will be an HTML table showing which ones have the same keys and values

I made a class to represent one database. It has connection info, a description and a collection of rows. It doesn't feel very cohesive so far.

I thought about your compositing type idea before and just couldn't get my head around it. With the two-list thingie, I've always had one as "master" so I could definitively say when something was "missing" or "extra" or represented an insert or delete. With this thing I think all I can know is the values match across the line or they don't. And really I think that's all that is interesting.
[ August 28, 2006: Message edited by: Stan James ]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Yeah, that interface broke it loose. Here's how the algorithm ended up ... real simple. Hmmm, maybe I'll go back and work on some names.

and

[ August 28, 2006: Message edited by: Stan James ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Test Suggestions ...
 
Similar Threads
JDBC/SQL/Financial Interview Question
Combining Text Files
comparing two comma delimited files
Merge Files
Question on looping thru 2 recordsets