addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1launch-new-window--smalllight-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: Pros + cons of various testing frameworks...

From: Steve M.
Sent on: Sunday, August 23, 2009 3:05 PM
Hi Jon,

I agree with many of the previous comments -- and I would add that I 
continue to use Ruby Unit test framework in Rails and am quite happy 
with it. There are quirks in the Rails integration but a lot of stuff 
got fixed in the 2.3.x releases.

In particular I like it b/c writing code in Test::Unit feels similar to 
how writing code for models feels. So I'm not using one syntax for 
testing and another for code writing (as I'm often tabbing back and 
forth). I know a lot of people love Rspec, webrat, etc.

Whatever framework you decide to use, one tip that might be helpful in 
building legacy tests, is to start with your "smoke tests." You could 
build a lot of: "Given this set of parameters, this GET request should 
return 200-Ok, and in the resulting HTML there should be an input tag 
with this value." This sets some a baseline harness around your system 
to define it's behavior in the most fundamental way (these parameters 
in, this html out).

It's not the ideal way to build TDD from the ground up, but I've found 
it can help to give you some control over your overall environment, so 
that as you change code, you can be confident that your major 
functionality hasn't just failed.

I agree with a previous poster that models give you lots of bang/buck, 
if you're writing "fat model" style, but for a legacy app, the 
integration and functional tests might be a lot easier to start in on.

Best,

Steve

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy