in reply to What is a testing plan?
use strict; use warnings; use Test::More; use_ok('My::New::Module'); my $obj = My::New::Module->new; ok( $obj ); isa_ok( $obj, 'My::New::Module' );
We've already tested some very important things: We can load the module, the constructor returns a true value, and that value is an object of the type we've been expecting.
If you're the type of person who can plan your modules completely ahead of time, go ahead and write simple tests for each method that this object will have, making sure they return the correct values and alter the object's internal state properly.
Personally, I tend to develop modules and tests in parallel, writing a feature, making sure it works to my satisfaction, and then writing a test to make sure it continues to work that way. Sometimes I get lazy and don't write the tests until the very end.
The most important thing is not to get too bogged down in dogma. Experiment a lot and do what works best for you and increases your productivity. Don't worry yourself if you're not strictly adhering to "red, green, refactor." Development methodologies should be taken as advice, not instructions. You must always find your own way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What is a testing plan?
by Ovid (Cardinal) on Mar 02, 2006 at 21:25 UTC | |
by xdg (Monsignor) on Mar 02, 2006 at 21:44 UTC |