talexb has asked for the wisdom of the Perl Monks concerning the following question:
Once again, I am creating a zoo of OO Perl modules from scratch, and given the opportunity I am using test Driven Development (TDD), which I have to say is a great way to code.
Having built three OO modules so far, I am running into a problem. I want to test creating objects with as many different combinations as possible, and my general test plan is
I'd like to try lots of different choices when I create the objects, and later test that all of the choics I made were correctly stored in the instantied object. The two methods I can think of for doing that are 1. nested loops, and 2. a single loop that increments a number, along with a series of tests inside the loop that checks for a particular bit and, if set, enables that particular option.
Aside: Hmm, maybe the way I should be doing it is create a named object in one scope, and then immediately test the named object in another scope, all inside one loop ..
Neither of these seem very elegant .. I did find Math::Combinatorics on CPAN but that's not really want I'm looking for. Has anyone else come across this particular challenge?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing and combinations
by chromatic (Archbishop) on Oct 30, 2007 at 22:02 UTC | |
|
Re: Testing and combinations
by GrandFather (Saint) on Oct 30, 2007 at 19:52 UTC | |
by talexb (Chancellor) on Oct 30, 2007 at 20:23 UTC | |
by GrandFather (Saint) on Oct 30, 2007 at 20:46 UTC | |
by talexb (Chancellor) on Oct 30, 2007 at 20:57 UTC | |
|
Re: Testing and combinations
by jdporter (Paladin) on Oct 30, 2007 at 23:02 UTC |