Ahh, my least favorite topic, test. First, I must confess that I don't programmatically test my rails stuff. I'm just now getting to the point where I have to start, but I hate it so much I've been procrastinating. Long ago, (1984 thru 1987) I managed a large project with 9 developers, and testing was such a pain in the butt, it traumatize me for life, all we had back then was sccs and make. When I started using rails and saw how test was actually baked in, it made me think, 'Great, testing will be much simpler than the last time I went through it', which led to sever procrastination.
Anyway, Functional Testing (we used to call it Unit test), tests the smallest bit's of functionality, i.e. you have a helper function called calcRate, which given two arguments, calculates some third specific value. The order of the arguments is important. So you unit test that function, and verify that if called with values 1 and 2, it returns 3.
Integration testing tests that your units work when used together (when integrated to each other.) It is the next level up from Unit test. For example, you've verified that calcRate works stand alone, but calcRate is called multiple places in your app, what if one programmer reversed the arguments, called it with 2,1 instead of 1,2. Integration testing is where you'd detect that error.
If you were to decide to only do one or the other, Integration testing is probably where you'll get the most bang for your buck, especially if there is more than one developer involved in the project. But you should still probably Unit test stuff that is crucial, i.e. balanceDue.
Last edited by BradHodges (2012-04-08 11:27:00)
Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.