Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Re: Trojan Perl Distributions

by stvn (Monsignor)
on May 05, 2004 at 20:40 UTC ( [id://350919]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Trojan Perl Distributions
in thread Trojan Perl Distributions

I see what you are saying, but no matter what integration tests like your example are tricky to write. But keep in mind that while you do feed the results into DBD::Mock, there is nothing to prevent you from feeding in incorrect results, or results you know will mess things up. In fact, that is one of the things it is best at, simulating error conditions that would otherwise require you to make a mess out of your database.

In alot of cases, I like to develop against a real database, because in the end, that is the situation it needs to work in. It just makes sense to me to do it this way. After I am satisfied my module works, I have been converting the live DB test code to use DBD::Mock and adding tests at the end to also verify my SQL statements. The conversion from DBD::mysql to DBD::Mock is pretty minimal, it only requires that a seed my results, which is much easier than writing the code to make, manage and destroy test database.

-stvn
  • Comment on Re: Re: Re: Re: Trojan Perl Distributions

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://350919]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-18 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found