in reply to [SOLVED]: Creation of object having weird side effect on my code

So what you want with testing is a general strategy that helps you eliminate possibilities like class instantiation errors, data type problems, etc. before moving on to so-called use cases. Cheesy example:

perl -e 'package foo; sub new { return bless {}} package main; my $new + = new foo(); use Test::More qw~no_plan~; diag(qq~High level prelimin +ary testing...~); ok(1==1,qq~basic~); ok($new->isa(qq~foo~), qq~Is a +foo~); diag(qq~Use Case 1: Editing customers...~);'

If you follow a methodology where you start by eliminating the high level possibilities like dependencies, environment, and establishing that objects are in the proper states you will find that your tests themselves answer most (if not all) of your questions.

Celebrate Intellectual Diversity

  • Comment on Re: [SOLVED]: Creation of object having weird side effect on my code
  • Download Code