Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've just started to dive into Catalyst and I have to say I'm loving it. It makes the easy things easy, provides the right framework to work in, and has been the impetus for me to really start learning TT and CDBI. One of best things is that Catalyst creates the initial test scaffolding for you, broken down by functional area. So, you have your application tests, and then the tests for each of the MVC components in their own subdirectory of t/. It even comes with its own Apache::Test-like infrastructure, so you can test without needing Apache or mod_perl installed. However, I'm not sure what I should be testing.

With the controllers, I'm pretty comfortable with the idea of mocking up the appropriate model and view classes so that I know what I'm testing. So, that's not a big issue.

With respect to CDBI, Catalyst uses Class::DBI::Loader to auto-generate the CDBI classes for you, based on your schema. My CDBI classes literally look like:

package MyApp::M::CDBI::MyTable; use strict; 1; __END__
I've looked at Automated testing of database classes, but then I realized that since I'm not modifying the classes, any additional tests I write beyond the use_ok()-type tests will be testing CDBI::Loader, and so they shouldn't be in my application's test suite. So, should I write any tests here? I'm comfortable without any, but am I missing something?

With respect to TT, I've got a lot of .tt files that get PROCESS'ed into my templates, where appropriate. I also have a lot of BLOCKs, WRAPPERs, and the like. Catalyst provides a MyApp::V::TT, but that's the place where Catalyst ends and TT begins. I've got my TT configuration options and some every-page values (like my menubar), but I'm not testing any of the actual TT code. Ideally, I'd like testing the actual TT snippets, but I'm at a loss for where to begin. An additional facet is that a lot of these snippets are probably going to be used in other projects, so I'd ideally like for them to have their own test suites ... ?

Basically, I'm literally asking for wisdom here. Catalyst, CDBI, and TT are all amazing infrastructures, but they're very daunting and I'm at a loss for where to begin when it comes to a test suite.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

In reply to Testing TT and CDBI under Catalyst by dragonchild

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (2)
    As of 2020-02-23 02:52 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (102 votes). Check out past polls.