Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
To me my Class::DBI objects are just objects that are constructed differently - either being restored from a database, or whatever.

My subclasses are autogenerated from a SQLFairy scheme objects (sometime soon it might make it the CPAN), so I have two tests per class:

  • schema test
  • functionality test

The schema tests make sure that important fields are there, and relationships work, and exist (->meta_info), proper subclassing is done, and so forth. Since all of this is auto generated, I write these before I write the schema, and then go through the schema slowly passing the tests.

The functionality tests take the objects, and create them throught the CDBI interface, and work with them. These tests are not concerned about how the cdbi objects even persist. They would work if a compatible interface was based on Storable, for example. They test the functionality as defined by the subclass.

Since I have funky stuff going on (Class::Delegation AUTOLOADing accessors to a Storable'd has in a BLOB, for example), these tests are pretty comprehensive.

What i'm trying to point out is that this layer, the database persistence, has two concerns - correct definition of the persistence semantics, and correct functionality of the persisting objects (perhaps including the fact that they properly persist). Neither of these concerns have to do with the database itself. That's for Class::DBI to test, and indeed it does. If you feel you can help it test more comprehensively, then you should submit these tests to Class::DBI.

-nuffin
zz zZ Z Z #!perl

In reply to Re: Automated testing of database classes by nothingmuch
in thread Automated testing of database classes by MrCromeDome

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found