mp has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to come up with a way to build a framework that will let developers code and unit test their yet-to-be-written modules to extend the web application without having to use the actual API code (except for integration testing) and without apache/mod_perl.
I've written quite a few perl tests before and am familiar with and have used Test::MockObject, Test::MockModule, Test::More, etc., but thing I'm having a hard time trying to figure out is at a high level, how to structure this test framework in such a way that there's not a bunch of code duplication. I've used Test::Class a little, and maybe it is a good approach and I'm just not "getting it" enough yet.
One approach I've thought of doing is to write mock versions of all the API libraries that provide some means for controlling the return values and that don't do any real database access. Then, the test code would 'use' these rather than the real API modules, but this doesn't really feel like the best approach because there are too many unknowns at this point.
Are there any other good approaches to these sort of test frameworks? Any pointers to reading material or even what to search for on Google would be appreciated. I do have a copy of O'reilly's Perl Testing, which has been helpful.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Architecting a testing framework for an API
by Old_Gray_Bear (Bishop) on Mar 23, 2006 at 02:41 UTC | |
Re: Architecting a testing framework for an API
by chromatic (Archbishop) on Mar 23, 2006 at 06:47 UTC | |
by mp (Deacon) on Mar 23, 2006 at 22:33 UTC | |
Re: Architecting a testing framework for an API
by adrianh (Chancellor) on Mar 23, 2006 at 10:09 UTC | |
by mp (Deacon) on Mar 23, 2006 at 22:27 UTC | |
by adrianh (Chancellor) on Mar 24, 2006 at 09:31 UTC | |
Re: Architecting a testing framework for an API
by adrianh (Chancellor) on Mar 23, 2006 at 10:19 UTC | |
by mp (Deacon) on Mar 26, 2006 at 00:11 UTC |