in reply to Re: DBD::Mock -- Giving back wrong data and wrong *amounts* of data
in thread DBD::Mock -- Giving back wrong data and wrong *amounts* of data

Ok, I see... I'm doing this testing within a framework that handles much of the SQL behind the scenes. I'll try to capture some of the queries being produced and associate them with good records.

Is there a better approach to it than that?

  • Comment on Re^2: DBD::Mock -- Giving back wrong data and wrong *amounts* of data

Replies are listed 'Best First'.
Re^3: DBD::Mock -- Giving back wrong data and wrong *amounts* of data
by andreas1234567 (Vicar) on Aug 21, 2009 at 09:22 UTC
    Is there a better approach to it than that?
    I would start by asking myself what is it I want to test? Write a test strategy, and take it on from there. Then break it down to individual tests e.g.
    • Does the application behave as I expect when the database is unavailable?
    • Does the application behave as I expect when the database returns unexpected results (e.g. no data, wrong charset, wrong number of columns, wrong data types, ..)?
    • Does the application behave as I expect in a foreign environment (e.g. on a different OS)?
    • ..

    Suggested reading: Perl Testing.

    You may also want to take a look at Test::MockDBI (Disclaimer: I one filed a patch to the given module and ended up as its' co-maintainer).

    Best of luck.

    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]