blazar has asked for the wisdom of the Perl Monks concerning the following question:
I've read much here and there about tests, but due to my typical programming tasks I've never really needed to write any, with some minor exceptions. Now I have some codebase that has served me right for quite a lot of time, but I {want,need} to
The point is that I want to start from the current implementation of the thingie, which in turn must be a sort of reference one, as a starting point: thus I want to write tests for any improved one, that will make sure it will behave like the former in "all" commonly covered cases. I see two possible strategies:
The first approach is obvious, and with the second I mean something like moving code to a "private" (e.g. with a particular naming scheme) module and write tests like:
ok( func eq _Reference::func, 'func');
I see pros and cons in both ways. Any idea?!?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Recommendations re tests wrt a reference implementation
by guinex (Sexton) on Jun 19, 2007 at 18:03 UTC | |
by roboticus (Chancellor) on Jun 19, 2007 at 19:43 UTC | |
|
Re: Recommendations re tests wrt a reference implementation
by Old_Gray_Bear (Bishop) on Jun 19, 2007 at 16:27 UTC | |
by blazar (Canon) on Jun 19, 2007 at 17:09 UTC | |
|
Re: Recommendations re tests wrt a reference implementation
by agianni (Hermit) on Jun 19, 2007 at 18:27 UTC | |
by blazar (Canon) on Jun 22, 2007 at 08:27 UTC |