Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: Moose - nalia

by stvn (Monsignor)
on Mar 23, 2008 at 01:28 UTC ( #675707=note: print w/replies, xml ) Need Help??


in reply to Re^4: Moose - nalia
in thread Moose - nalia

Any advice on test driven development in Moose? Any preferred testing idioms? Any affordances or most optimal leveraging of Moose and testing idioms?

I write my tests with Moose the same way I wrote them without Moose actually, using Test::More and friends. We do have a Test::Moose module included in the distro which provides a few helpers, it is a relatively new module too, so any ideas for additional testing functions are welcome.

The only real difference between my pre-Moose tests and the tests I write now is that I am no longer testing things like accessors or object creation or correct type usage, cause I know that Moose tests all that for me. The Moose test suite currently has 2926 test across 133 files, and the Class::MOP test suite has 1971 test across 56 files, in addition to this we regularly smoke test the MooseX:: modules in our svn repository which adds another thousand tests or so. Because of this, I feel pretty confident that I only need to test what it is my module does, and not that the OO is working correctly. This is not unlike writing tests in a compiled and statically typed language like Java, Haskell or OCaml, in those languages the compiler will do a kind of sanity check on the code, leaving you to just test what it is your code actually does.

-stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://675707]
help
Chatterbox?
[usemodperl]: what the hell happened to the monastery?
usemodperl gets scolded by little old ladies on every dang post
[usemodperl]: did we get invaded by soy boys or what? it wasn't like this 20 years ago :-)
[usemodperl]: i can see the old tgimers hiding out on reddit! lol
[usemodperl]: no wonder this place is so... popular
[marto]: your account is 7 days old, how old are these 'old tgimers'?
[choroba]: usemodpoerl Do you have a question? Do you want to help someone? Or do you just want to troll?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-06-24 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?