I have a lot of code that is used to cleanup, correct, & verify mailing addresses from various data sources. (I post a lot about this). We have been designing the next-generation address parser for work, and are trying to figure out the best way to incrememtally test the new code and replace the old code. We'll want to run the old version in parallel with the new version and compare the results. The comparisons would be written to a report that would help us tweak the new code. A simple way to do this would be something like:
sub parallel_tester {
# assume neither parser modifies @_
my $old_result = old_parser(@_);
my $new_result = new_parser(@_);
compare_n_report($old_result, $new_result, @_);
}
But, at some point the new parser will want to take over from the old parser. If all the functions / classes / methods in the new parser are coded with different names, we'll have to go through that code and modify all the names of the functions and the calling of them.
So, we're trying to figure out the best way to deal with this code crossover. The main idea we have is to play some sort of games with package names so that all that needs to be done is change what is required / used etc.
I know that this is a quite vague question, and we haven't experimented much, but i see us going down a lot of very wrong paths before figuring out a good way to handle this upgrade. And unfortunately, this isnt a matter of replacing a function with a new version and testing the logic of that function, because the function could behave exactly as we designed it to, but because of the overall problem, the whole thing needs to be tested as a unit, and there will actually be very little replacing of one part of the old code with a new version, the whole project will be re-written.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.